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

Terry Reedy tjreedy at udel.edu
Sun Aug 16 13:39:40 CEST 2009

Xavier Ho wrote:

> I'm really looking for a way to set up Python classes' natural ordering 
> for sorting purposes.

I believe __lt__ (<) is the only method (operator) used by both .sort 
and heap module.

More information about the Python-list mailing list