We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a573cb2 commit d7d4a05Copy full SHA for d7d4a05
Lib/heapq.py
@@ -12,6 +12,8 @@
12
item = heappop(heap) # pops the smallest item from the heap
13
item = heap[0] # smallest item on the heap without popping it
14
heapify(x) # transforms list into a heap, in-place, in linear time
15
+item = heappushpop(heap, item) # pushes a new item and then returns
16
+ # the smallest item; the heap size is unchanged
17
item = heapreplace(heap, item) # pops and returns smallest item, and adds
18
# new item; the heap size is unchanged
19
0 commit comments