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

Raymond Hettinger python at rcn.com
Sun Aug 16 18:33:59 CEST 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:



More information about the Python-list mailing list