Would there be support for a more general cmp/__cmp__

Duncan Booth duncan.booth at invalid.invalid
Thu Oct 20 03:30:41 EDT 2005


Antoon Pardon wrote:

> The problem now is that the cmp protocol has no way to
> indicate two objects are incomparable, they are not
> equal but neither is one less or greater than the other.

If that is the case then you implement __eq__ and __ne__ to return 
True/False and make cmp throw an exception. I don't see any need to extend 
the cmp protocol.



More information about the Python-list mailing list