Using Heapq Python Documentation For Loop