[Python-3000] Total ordering and __cmp__

Josiah Carlson jcarlson at uci.edu
Wed Mar 21 16:14:14 CET 2007


Georg Brandl <g.brandl at gmx.net> wrote:
> Guido van Rossum schrieb:
> > I haven't taken any action, and it looks like __cmp__ isn't being
> > called. I'd rather not add it back; if you want it back, could you at
> > least write up a brief PEP? A patch would also help; I recall that it
> > was quite a relief being able to cut it out, so I expect that patching
> > it back in would be quite cumbersome.
> 
> BTW, was it intentional that dicts can't be compared via ">" and "<"
> anymore?

Being that dictionaries are *unordered* mappings of keys to values, is
there an ordering on dictionaries that makes any sense?  If I understand
the changes in comparisons correctly, the point is to remove a total
ordering on all Python objects, as it is currently broken.  For objects
that have no reasonable ordering (imaginary vs float, tuples vs unicode,
set vs. set, etc.), the only comparisons that return anything useful are
x == y and x != y.


 - Josiah



More information about the Python-3000 mailing list