[Python-checkins] gh-101777: Make `PriorityQueue` docs slightly clearer (#102026)

erlend-aasland webhook-mailer at python.org
Tue Feb 21 05:24:40 EST 2023


https://github.com/python/cpython/commit/350ba7c07f8983537883e093c5c623287a2a22e5
commit: 350ba7c07f8983537883e093c5c623287a2a22e5
branch: main
author: Owain Davies <116417456+OTheDev at users.noreply.github.com>
committer: erlend-aasland <erlend.aasland at protonmail.com>
date: 2023-02-21T11:24:33+01:00
summary:

gh-101777: Make `PriorityQueue` docs slightly clearer (#102026)

Adjust wording slightly, and use min(entries) instead of
sorted(list(entries))[0] as an example.

files:
M Doc/library/queue.rst

diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst
index c67f15e953bc..46b8e9b18a3c 100644
--- a/Doc/library/queue.rst
+++ b/Doc/library/queue.rst
@@ -57,8 +57,8 @@ The :mod:`queue` module defines the following classes and exceptions:
    *maxsize* is less than or equal to zero, the queue size is infinite.
 
    The lowest valued entries are retrieved first (the lowest valued entry is the
-   one returned by ``sorted(list(entries))[0]``).  A typical pattern for entries
-   is a tuple in the form: ``(priority_number, data)``.
+   one that would be returned by ``min(entries)``). A typical pattern for
+   entries is a tuple in the form: ``(priority_number, data)``.
 
    If the *data* elements are not comparable, the data can be wrapped in a class
    that ignores the data item and only compares the priority number::



More information about the Python-checkins mailing list