On this page
heapq.heappushpop_max
Prev: heapq.heappushpop | Up: heapq | Next: heapq.heapreplace
Rel: heapq.heapify, heapq.heapify_max, heapq.heappop, heapq.heappop_max
Ref: docs.python.org — heapq.heappushpop_max
Tags: #public #python3 #stdlib #heapq
Import
import heapq
from heapq import heappushpop_max
Signature & Overview
heapq.heappushpop_max(heap, item, /)
Maxheap variant of heappushpop.
Usage
import heapq
# Python 3.14+: max-heap counterpart to heappushpop()
assert hasattr(heapq, "heappushpop_max") or True
Gotchas
- Requires Python 3.14+.
REPL Inspect
from heapq import heappushpop_max
help(heappushpop_max)
Linked from
Related notes
- tuts/python3/stdlib_module/heapq/heappushpop Linked here; links to this page; shared tags: #heapq, #stdlib
- tuts/python3/stdlib_module/heapq/heapreplace Linked here; links to this page; shared tags: #heapq, #stdlib
- tuts/python3/stdlib_module/heapq Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/heapq/heapify Linked here; shared tags: #heapq, #stdlib
- tuts/python3/stdlib_module/heapq/heapify_max Linked here; shared tags: #heapq, #stdlib
- tuts/python3/stdlib_module/heapq/heappop Linked here; shared tags: #heapq, #stdlib
- tuts/python3/stdlib_module/heapq/heappop_max Linked here; shared tags: #heapq, #stdlib
- tuts/python3/stdlib_module/heapq/heappush shared tags: #heapq, #stdlib
- tuts/python3/stdlib_module/heapq/heappush_max shared tags: #heapq, #stdlib
- tuts/python3/stdlib_module/heapq/heapreplace_max shared tags: #heapq, #stdlib