def __iter__(self):
        "Return a destructive iterator over the heap's elements"
        try:
            while True:
                yield self.popmin()
        except IndexError:
            pass
Return a destructive iterator over the heap's elements
recipes/Python/437116_Wrapper_class_heapq/recipe-437116.py