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

Method __iter__

recipes/Python/437116_Wrapper_class_heapq/recipe-437116.py:24–30  ·  view source on GitHub ↗

Return a destructive iterator over the heap's elements

(self)

Source from the content-addressed store, hash-verified

22 return item
23
24 def __iter__(self):
25 "Return a destructive iterator over the heap's elements"
26 try:
27 while True:
28 yield self.popmin()
29 except IndexError:
30 pass
31
32 def reduce(self, pos, newitem):
33 "Replace self[pos] with a lower value item and then reheapify"

Callers

nothing calls this directly

Calls 1

popminMethod · 0.95

Tested by

no test coverage detected