This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Update the min()/max() docs for the new default argument
Type: Stage: resolved
Components: Documentation Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: berker.peksag, docs@python, ezio.melotti, larry, python-dev, rhettinger
Priority: normal Keywords: patch

Created on 2014-02-13 20:08 by rhettinger, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue20620_v2.diff berker.peksag, 2014-02-27 17:22 review
issue20620_v3.diff berker.peksag, 2014-05-19 00:44 review
Messages (7)
msg211168 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-02-13 20:08
There is a new "default" argument for min() and max():

    >>> min([], default=10)
    10

The new argument is not currently shown by help():

    >>> help(min)
    Help on built-in function min in module builtins:

    min(...)
        min(iterable[, key=func]) -> value
        min(a, b, c, ...[, key=func]) -> value
        
        With a single iterable argument, return its smallest item.
        With two or more arguments, return the smallest argument.
msg211225 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-02-14 17:38
Here's a patch to update the min() and max() documentations.
msg211452 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-02-17 22:45
key and default are keyword-only arguments, the signature should have a '*'.
msg212371 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-02-27 17:22
Updated patch adressing Larry's comment. I also fixed a typo in the max() documentation. Thanks!
msg218773 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-05-19 00:44
Rebased patch.
msg218818 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-05-19 21:21
New changeset b60258f4499c by Raymond Hettinger in branch '3.4':
Issue 20620: Update the min()/max() docs for the new default argument.
http://hg.python.org/cpython/rev/b60258f4499c
msg218819 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-05-19 21:22
Thanks for the patch.
History
Date User Action Args
2022-04-11 14:57:58adminsetgithub: 64819
2014-05-19 22:45:15berker.peksagsetstage: patch review -> resolved
2014-05-19 21:22:15rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg218819
2014-05-19 21:21:34python-devsetnosy: + python-dev
messages: + msg218818
2014-05-19 00:44:21berker.peksagsetfiles: - issue20620.diff
2014-05-19 00:44:05berker.peksagsetfiles: + issue20620_v3.diff

messages: + msg218773
versions: + Python 3.5
2014-02-27 17:22:32berker.peksagsetfiles: + issue20620_v2.diff

messages: + msg212371
stage: patch review
2014-02-17 22:45:55larrysetmessages: + msg211452
2014-02-15 16:10:49ezio.melottisetnosy: + ezio.melotti
2014-02-14 17:38:58berker.peksagsetfiles: + issue20620.diff

nosy: + berker.peksag
messages: + msg211225

keywords: + patch
2014-02-14 01:53:30yselivanovsetnosy: + larry
2014-02-13 20:08:49rhettingercreate