Numeric comparison anomaly

Piet van Oostrum piet at
Sat Feb 22 18:08:51 CET 2003

>>>>> Gary Herron <gherron at> (GH) wrote:

GH> Actually, Python's > *is* an ordering, but he is *not* using 
GH> python's > operator.  He has redefined it (in a silly fashion)
GH> with the __cmp__ method.

What I meant is that, if you use '>', you usually expect it to have the
properties of an ordering. That implementation did not have that property.
Most people probably even expect it to be a total ordering.
And nom Python's > is *not* an ordering, at least not for general objects.
It is possible to have a > b > a for certain objects a and b.
Piet van Oostrum <piet at>
Private email: P.van.Oostrum at

More information about the Python-list mailing list