MCPcopy Create free account
hub / github.com/ActiveState/code / popmin

Method popmin

recipes/Python/440673_Safe_heap_queue_class/recipe-440673.py:26–28  ·  view source on GitHub ↗

Pop the smallest item off the heap

(self)

Source from the content-addressed store, hash-verified

24 return heapq.heappush(self._lst, self._wrap(item))
25
26 def popmin(self):
27 '''Pop the smallest item off the heap'''
28 return self._unwrap(heapq.heappop(self._lst))
29
30 def replace(self, item):
31 '''Equivalent to "x = heap.popmin(); heap.push(); return x" but more

Callers 3

__iter__Method · 0.95
iterpopMethod · 0.95
recipe-437116.pyFile · 0.80

Calls 1

_unwrapMethod · 0.95

Tested by

no test coverage detected