summaryrefslogtreecommitdiffstats
path: root/Doc/library/heapq.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/heapq.rst')
-rw-r--r--Doc/library/heapq.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst
index f26d29b..1530144 100644
--- a/Doc/library/heapq.rst
+++ b/Doc/library/heapq.rst
@@ -43,6 +43,13 @@ The following functions are provided:
Pop and return the smallest item from the *heap*, maintaining the heap
invariant. If the heap is empty, :exc:`IndexError` is raised.
+.. function:: heappushpop(heap, item)
+
+ Push *item* on the heap, then pop and return the smallest item from the
+ *heap*. The combined action runs more efficiently than :func:`heappush`
+ followed by a separate call to :func:`heappop`.
+
+ .. versionadded:: 2.6
.. function:: heapify(x)