summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-02-21 10:31:51 (GMT)
committerGitHub <noreply@github.com>2023-02-21 10:31:51 (GMT)
commit2d9f8d4d3882968dbc8fb2bceeb51d4c31fcd7b1 (patch)
treec85eab5ee49b658793b8090f90908e9058593390
parentd9dce23643c319ff4f721ad65a7f9811e8adfc53 (diff)
downloadcpython-2d9f8d4d3882968dbc8fb2bceeb51d4c31fcd7b1.zip
cpython-2d9f8d4d3882968dbc8fb2bceeb51d4c31fcd7b1.tar.gz
cpython-2d9f8d4d3882968dbc8fb2bceeb51d4c31fcd7b1.tar.bz2
gh-101777: Make `PriorityQueue` docs slightly clearer (GH-102026)
Adjust wording slightly, and use min(entries) instead of sorted(list(entries))[0] as an example. (cherry picked from commit 350ba7c07f8983537883e093c5c623287a2a22e5) Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
-rw-r--r--Doc/library/queue.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst
index c67f15e..46b8e9b 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::