[Python-ideas] Making min and max behave more like any and all

Guido van Rossum guido at python.org
Wed Nov 30 19:26:21 CET 2011


On Wed, Nov 30, 2011 at 10:22 AM, Masklinn <masklinn at masklinn.net> wrote:

> On 2011-11-30, at 19:15 , Guido van Rossum wrote:
> >> In the first case this becomes illegal
> >> max(1,2,3,4,5)
> >>
> >
> > Which I presume is rarely needed but if necessary can easily be written
> as
> > max((1, 2, 3, 4, 5)).
> The *args form is rather nice for the (pretty common I'd think) task of
> min/maxing a pair of values, one know (default) and one unknown for
> instance.
>
> It is also a common interface for min/max functions.


Of course. IMO the status quo is optimal -- max(a, b) is very useful. Not
so for any(a, b) though.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20111130/614ed30c/attachment.html>


More information about the Python-ideas mailing list