Issue36731
Created on 2019-04-26 03:01 by Windson Yang, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg340878 - (view) | Author: Windson Yang (Windson Yang) * | Date: 2019-04-26 03:01 | |
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.get() We may also need to add Notes about the PriorityQueue will block when we use max size > q = Q.PriorityQueue(1) > q.put(10) > q.put(1) # will block until the Queue is available again. |
|||
| msg340891 - (view) | Author: Raymond Hettinger (rhettinger) * ![]() |
Date: 2019-04-26 07:43 | |
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.PriorityQueue() which does have put(), get(), and maxsize. As for the queue docs, I don't think more examples are needed. IMO it would just clutter that part of the docs. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:14 | admin | set | github: 80912 |
| 2019-04-26 07:43:22 | rhettinger | set | status: open -> closed nosy:
+ rhettinger resolution: rejected |
| 2019-04-26 03:01:37 | Windson Yang | create | |
