Raymond Hettinger added the comment:
This doesn't make any sense. None of those operations are defined for the
heapq module, nor is there a maxsize. The heapq usage notes are about the
general concept of ways to implement priority queues. I suspect your
suggestion is conflated with queue.
New submission from Windson Yang :
We don't have the base example for priority queue in
https://docs.python.org/3.8/library/heapq.html#priority-queue-implementation-notes,
We can add something like:
> q = Q.PriorityQueue()
> q.put(10)
> q.put(1)
> q.put(5)
> while not q.empty():
print q.g