[Python-checkins] python/dist/src/Doc/lib libheapq.tex,1.7,1.8
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Tue Jun 15 19:53:37 EDT 2004
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8872/Doc/lib
Modified Files:
libheapq.tex
Log Message:
Reverse argument order for nsmallest() and nlargest().
Reads better when the iterable is a generator expression.
Index: libheapq.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libheapq.tex,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** libheapq.tex 13 Jun 2004 05:26:32 -0000 1.7
--- libheapq.tex 15 Jun 2004 23:53:34 -0000 1.8
***************
*** 86,90 ****
The module also offers two general purpose functions based on heaps.
! \begin{funcdesc}{nlargest}{iterable, n}
Return a list with the \var{n} largest elements from the dataset defined
by \var{iterable}. Equivalent to: \code{sorted(iterable, reverse=True)[:n]}
--- 86,90 ----
The module also offers two general purpose functions based on heaps.
! \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]}
***************
*** 92,96 ****
\end{funcdesc}
! \begin{funcdesc}{nsmallest}{iterable, n}
Return a list with the \var{n} smallest elements from the dataset defined
by \var{iterable}. Equivalent to: \code{sorted(iterable)[:n]}
--- 92,96 ----
\end{funcdesc}
! \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]}
More information about the Python-checkins
mailing list