[Python-ideas] 'default' keyword argument for max(), min()

Tal Einat taleinat at gmail.com
Wed Apr 15 20:08:23 CEST 2009


On Wed, Apr 15, 2009 at 8:20 PM, Adam Atlas <adam at atlas.st> wrote:

> I propose adding a "default" keyword argument to max() and min(), which
> provides a value to return in the event that an empty iterable is passed.


+1

This has precedent in reduce()'s "initial" keyword argument; note that min()
and max() are really simple special cases of reduce().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090415/ad9c88b3/attachment.html>


More information about the Python-ideas mailing list