[Python-3000] Total ordering and cmp (original) (raw)
Guido van Rossum guido at python.org
Wed Mar 21 18:19:37 CET 2007
- Previous message: [Python-3000] Total ordering and __cmp__
- Next message: [Python-3000] Total ordering and __cmp__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 3/21/07, Georg Brandl <g.brandl at gmx.net> wrote:
BTW, was it intentional that dicts can't be compared via ">" and "<" anymore?
Yes. In old Python it made sense since all objects were supposed to be orderable somehow (in the truly distant past, comparisons weren't even allowed to raise exceptions!). In Py3k that assumption has been dropped. The ordering for dicts is not particularly useful, hard to explain, and hard to compute. On the other hand, equality testing is straightforward.
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-3000] Total ordering and __cmp__
- Next message: [Python-3000] Total ordering and __cmp__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]