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: add key= argument to min and max
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: bethard, rhettinger
Priority: normal Keywords: patch

Created on 2004-12-02 06:57 by bethard, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
minmax.diff bethard, 2004-12-02 06:57 changes to min/max builtins and test_builtin.py
Messages (2)
msg47356 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2004-12-02 06:57
Adds a key= keyword argument to the builtin functions
min and max.  This argument works just like key for
list.sort and sorted, so that the values compared by
the min/max routine are produced by applying the key=
function to the item under consideration.  Note that
key= is *only* a keyword argument and cannot be
accessed as a positional argument so as not to
interfere with the max(a, b, c, ...) form of the functions.
msg47357 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-12-03 08:31
Logged In: YES 
user_id=80475

Added various fixups (arg handliing, error handling, ref
counts, more tests, docs, news item, and acknowledgement).

Accepted and applied.

See:
    Python/bltinmodule.c 2.319
History
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41275
2004-12-02 06:57:06bethardcreate