[Python-checkins] python/dist/src/Lib heapq.py,1.25,1.26

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Mon Sep 6 09:04:11 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29812/Lib

Modified Files:
	heapq.py 
Log Message:
Fix erroneous docstring comment.

Index: heapq.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/heapq.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- heapq.py	20 Jun 2004 09:07:52 -0000	1.25
+++ heapq.py	6 Sep 2004 07:04:09 -0000	1.26
@@ -154,9 +154,10 @@
     This is more efficient than heappop() followed by heappush(), and can be
     more appropriate when using a fixed-size heap.  Note that the value
     returned may be larger than item!  That constrains reasonable uses of
-    this routine unless written as part of a larger expression:
+    this routine unless written as part of a conditional replacement:
 
-        result = item <= heap[0] and item  or  heapreplace(heap, item)
+        if item > heap[0]:
+            item = heapreplace(heap, item)
     """
     returnitem = heap[0]    # raises appropriate IndexError if heap is empty
     heap[0] = item



More information about the Python-checkins mailing list