[Python-3000] Please re-add __cmp__ to python 3000

"Martin v. Löwis" martin at v.loewis.de
Sat Nov 17 18:07:02 CET 2007


> It'd be simpler still if we only had __cmp__ and __eq__.  I just don't
> understand the use cases where that's not sufficient.
> 
> Hrm.  I guess set's subset checking requires more relationships than
> __cmp__ provides.  Abandoning that feature probably isn't an option,
> so nevermind me.
> 
> (Although, if we really wanted we could use -2/+2 to mean
> subset/superset, while -1/+1 mean smaller/larger.)

It's the difference between partial and total order. Some things have
only a partial order, so they can't implement __cmp__; or __cmp__ would
have to be extended to support "unordered" as a result.

Regards,
Martin



More information about the Python-3000 mailing list