Trouble with max() and __cmp__()

"Martin v. Löwis" martin at v.loewis.de
Sun Jan 28 23:05:59 CET 2007


Thomas Nelson schrieb:
> On Jan 28, 3:13 pm, Wojciech Muła 
> <wojciech_m... at poczta.null.onet.pl.invalid> wrote:
>> Define method __gt__.
> 
> This works, thanks.  I was a little surprised though. is __cmp__ used 
> by any builtin functions?

It is used by max() if the object doesn't implement __gt__.

Regards,
Martin



More information about the Python-list mailing list