[Patches] [ python-Patches-1077353 ] add key= argument to min and max

SourceForge.net noreply at sourceforge.net
Fri Dec 3 09:31:36 CET 2004


Patches item #1077353, was opened at 2004-12-02 01:57
Message generated for change (Settings changed) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077353&group_id=5470

Category: Core (C code)
Group: Python 2.5
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Steven Bethard (bediviere)
Assigned to: Raymond Hettinger (rhettinger)
Summary: add key= argument to min and max

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2004-12-03 03:31

Message:
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

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077353&group_id=5470


More information about the Patches mailing list