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

Method iterpop

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

Return a destructive iterator over the heap's elements. Each time next is invoked, it pops the smallest item from the heap.

(self)

Source from the content-addressed store, hash-verified

40 return item
41
42 def iterpop(self):
43 '''Return a destructive iterator over the heap's elements.
44
45 Each time next is invoked, it pops the smallest item from the heap.
46 '''
47 while self:
48 yield self.popmin()
49
50 #---- overrided ListMixin methods ----------------------------------------
51

Callers

nothing calls this directly

Calls 1

popminMethod · 0.95

Tested by

no test coverage detected