Would there be support for a more general cmp/__cmp__

Antoon Pardon apardon at forel.vub.ac.be
Thu Oct 20 03:14:51 EDT 2005


I was wondering how people would feel if the cmp function and
the __cmp__ method would be a bit more generalised.

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.

So I thought that either cmp could return None in this
case or throw a specific exception. People writing a
__cmp__ method could do the same.

-- 
Antoon Pardon



More information about the Python-list mailing list