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

David A. Wheeler dwheeler at dwheeler.com
Tue Oct 16 20:45:09 CEST 2007


I agree with Collin Winter: losing __cmp__ is a loss  (see http://oakwinter.com/code/).

Yes, it's possible to write all the comparison operations, but I think it's _clearer_ to create a single low-level operator that handles ALL the comparison operators.  It also avoids many mistakes; once you get that ONE operator right, ALL comparisons are right.  I think the python 2 way is better: individual operations for the cases where you want to handle each case specially, and a single __cmp__ function that is a simple way to handle comparisons all at once.

--- David A. Wheeler 


More information about the Python-3000 mailing list