[Python-Dev] Behaviour of max() and min() with equal keys

Hrvoje Niksic hrvoje.niksic at avl.com
Wed Sep 8 10:48:34 CEST 2010


On 09/07/2010 11:40 PM, Jeffrey Yasskin wrote:
> Decimal may actually have this backwards. The idea would be that
> min(*lst) == sorted(lst)[0], and max(*lst) == sorted(lst)[-1].

Here you mean "is" rather than "==", right?  The relations you spelled 
are guaranteed regardless of stability.

(This doesn't apply to Decimal.max and Decimal.min, which return new 
objects.)


More information about the Python-Dev mailing list