diff options
author | Raymond Hettinger <python@rcn.com> | 2004-06-15 23:53:35 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-06-15 23:53:35 (GMT) |
commit | aefde435efb8e99c74ad147e1a1db76fe5de61aa (patch) | |
tree | d32a79e48b1b6df8c6c4a5b84ba79902220bda9a /Doc | |
parent | 969297f488f314833e8ed591123deff7bd154cbd (diff) | |
download | cpython-aefde435efb8e99c74ad147e1a1db76fe5de61aa.zip cpython-aefde435efb8e99c74ad147e1a1db76fe5de61aa.tar.gz cpython-aefde435efb8e99c74ad147e1a1db76fe5de61aa.tar.bz2 |
Reverse argument order for nsmallest() and nlargest().
Reads better when the iterable is a generator expression.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libheapq.tex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/lib/libheapq.tex b/Doc/lib/libheapq.tex index 5a140ab..ffcafcd 100644 --- a/Doc/lib/libheapq.tex +++ b/Doc/lib/libheapq.tex @@ -85,13 +85,13 @@ True The module also offers two general purpose functions based on heaps. -\begin{funcdesc}{nlargest}{iterable, n} +\begin{funcdesc}{nlargest}{n, iterable} Return a list with the \var{n} largest elements from the dataset defined by \var{iterable}. Equivalent to: \code{sorted(iterable, reverse=True)[:n]} \versionadded{2.4} \end{funcdesc} -\begin{funcdesc}{nsmallest}{iterable, n} +\begin{funcdesc}{nsmallest}{n, iterable} Return a list with the \var{n} smallest elements from the dataset defined by \var{iterable}. Equivalent to: \code{sorted(iterable)[:n]} \versionadded{2.4} |