diff options
author | Raymond Hettinger <python@rcn.com> | 2004-12-03 08:30:39 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-12-03 08:30:39 (GMT) |
commit | 3b0c7c20a10349fbedeb3779582280363a46f087 (patch) | |
tree | 37592db6c5939f1a41252bbeba33c1408363238b /Doc/lib/libfuncs.tex | |
parent | e8fdc4502f71ba230dd1320926796925065f662e (diff) | |
download | cpython-3b0c7c20a10349fbedeb3779582280363a46f087.zip cpython-3b0c7c20a10349fbedeb3779582280363a46f087.tar.gz cpython-3b0c7c20a10349fbedeb3779582280363a46f087.tar.bz2 |
SF patch #1077353: add key= argument to min and max
(First draft of patch contributed by Steven Bethard.)
Diffstat (limited to 'Doc/lib/libfuncs.tex')
-rw-r--r-- | Doc/lib/libfuncs.tex | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index 2099f3f..904b4e1 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -642,16 +642,28 @@ class C: of sequence; the result is always a list. \end{funcdesc} -\begin{funcdesc}{max}{s\optional{, args...}} +\begin{funcdesc}{max}{s\optional{, args...}\optional{key}} With a single argument \var{s}, return the largest item of a non-empty sequence (such as a string, tuple or list). With more than one argument, return the largest of the arguments. + + The optional \var{key} argument specifies a one argument ordering + function like that used for \method{list.sort()}. The \var{key} + argument, if supplied, must be in keyword form (for example, + \samp{max(a,b,c,key=func)}). + \versionchanged[Added support for the optional \var{key} argument]{2.5} \end{funcdesc} \begin{funcdesc}{min}{s\optional{, args...}} With a single argument \var{s}, return the smallest item of a non-empty sequence (such as a string, tuple or list). With more than one argument, return the smallest of the arguments. + + The optional \var{key} argument specifies a one argument ordering + function like that used for \method{list.sort()}. The \var{key} + argument, if supplied, must be in keyword form (for example, + \samp{min(a,b,c,key=func)}). + \versionchanged[Added support for the optional \var{key} argument]{2.5} \end{funcdesc} \begin{funcdesc}{object}{} |