Scott Queen added the comment:
Fair statement. "Properly sorted" was a poor choice. Seems that "if the
invariant is true as a precondition, it will be true as a postcondition" is
accurate and descriptive - maybe with a caution that modifying the list
(heap) values by means
New submission from Scott Queen :
The documentation for heapq.heappop(heap) says:
"Pop and return the smallest item from the heap, maintaining the heap
invariant. If the heap is empty, IndexError is raised. To access the smallest
item without popping it, use heap[0]."
yet, in the