What happened to __cmp__() in Python 3.x?

Raymond Hettinger python at rcn.com
Sun Aug 16 12:33:59 EDT 2009


[Xavier Ho]
> > I've recently made my way to Python 3.1 and I'm not seeing __cmp__() in the
> > documentation.
>
> > Is there a substitution for this special method in 3.1, or do I really have
> > to define all six rich comparison methods to work it out?

FWIW, there is a recipe for expanding the comparison operators:

        http://code.activestate.com/recipes/576685/


Raymond



More information about the Python-list mailing list