Guido rethinking removal of cmp from sort method

Lie Ryan lie.1296 at
Fri Apr 8 12:12:51 EDT 2011

On 04/09/11 01:08, Aahz wrote:
> Actually, my take is that removing __cmp__ was a mistake.  (I already
> argued about it back in python-dev before it happened, and I see little
> point rehashing it.  My reason is strictly efficiency grounds: when
> comparisons are expensive -- such as Decimal object -- __cmp__ is
> faster.)

I don't get you... why would sorting a list using __cmp__ be faster when
comparisons are expensive?

More information about the Python-list mailing list