I support PEP 326
Paul Prescod
paul at prescod.net
Fri Jan 23 01:57:23 EST 2004
Andrew Koenig wrote:
>>I suppose you could special-case min() and max() to return the
>>appropriate singletons if called with no arguments.
>>
>>There's something very nice about that. There's also something very
>>ugly about it. I'm having a hard time deciding which is stronger :-)
>
>
> I'm afraid it's not right, because calling min() with no arguments should
> return Max and calling max() with no arguments should return Min.
>
> This behavior is correct because it preserves the intuitive property that if
> s1 and s2 are (possibly empty) sequences, min(min(s1),min(s2)) should be
> equal to min(s1+s2), and similarly for max. If you like, Max is the
> identity element for min and Min is the identity element for max.
Calling min with no arguments need not be the same as calling it with an
empty sequence argument. That is not necessarily an argument for making
the empty function call return something arguably strange...
Paul Prescod
More information about the Python-list
mailing list