Trouble with max() and __cmp__()

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

Thomas Nelson schrieb:
> On Jan 28, 3:13 pm, Wojciech Muła 
> <wojciech_m... at> 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__.


More information about the Python-list mailing list