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