[Python-checkins] python/dist/src/Doc/lib libheapq.tex,1.3,1.4
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Sat, 03 Aug 2002 11:53:30 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv12767/lib
Modified Files:
libheapq.tex
Log Message:
Document new heapreplace() function.
Index: libheapq.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libheapq.tex,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** libheapq.tex 3 Aug 2002 18:02:09 -0000 1.3
--- libheapq.tex 3 Aug 2002 18:53:28 -0000 1.4
***************
*** 53,56 ****
--- 53,65 ----
\end{funcdesc}
+ \begin{funcdesc}{heapreplace}{heap, item}
+ Pop and return the smallest item from the \var{heap}, and also push
+ the new \var{item}. The heap size doesn't change.
+ This is more efficient than \function{heappop()} followed
+ by \function{heappush()}, and can be more appropriate when using
+ a fixed-size heap. Note that the value returned may be larger
+ than \var{item}! That constrains reasonable uses of this routine.
+ \end{funcdesc}
+
Example of use: