MCPcopy Create free account
hub / github.com/RustPython/RustPython / heappush

Function heappush

Lib/heapq.py:133–136  ·  view source on GitHub ↗

Push item onto heap, maintaining the heap invariant.

(heap, item)

Source from the content-addressed store, hash-verified

131 'heappushpop_max', 'nlargest', 'nsmallest', 'merge']
132
133def heappush(heap, item):
134 """Push item onto heap, maintaining the heap invariant."""
135 heap.append(item)
136 _siftdown(heap, 0, len(heap)-1)
137
138def heappop(heap):
139 """Pop the smallest item off the heap, maintaining the heap invariant."""

Callers 2

_putMethod · 0.90
_putMethod · 0.85

Calls 3

_siftdownFunction · 0.85
lenFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected