New submission from Windson Yang <wiwind...@outlook.com>:

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.

----------
assignee: docs@python
components: Documentation
messages: 340878
nosy: Windson Yang, docs@python
priority: normal
severity: normal
status: open
title: Add example to priority queue
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36731>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to