I support PEP 326

Andrew Koenig ark at acm.org
Fri Jan 23 00:55:25 EST 2004


> 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.





More information about the Python-list mailing list