Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cb150e2

Browse files
OTheDevpython-sidebar
authored andcommittedSep 1, 2024
pythongh-101777: Make PriorityQueue docs slightly clearer (python#102026)
Adjust wording slightly, and use min(entries) instead of sorted(list(entries))[0] as an example.
1 parent 4d04a5a commit cb150e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎Doc/library/queue.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ The :mod:`queue` module defines the following classes and exceptions:
5757
*maxsize* is less than or equal to zero, the queue size is infinite.
5858

5959
The lowest valued entries are retrieved first (the lowest valued entry is the
60-
one returned by ``sorted(list(entries))[0]``). A typical pattern for entries
61-
is a tuple in the form: ``(priority_number, data)``.
60+
one that would be returned by ``min(entries)``). A typical pattern for
61+
entries is a tuple in the form: ``(priority_number, data)``.
6262

6363
If the *data* elements are not comparable, the data can be wrapped in a class
6464
that ignores the data item and only compares the priority number::

0 commit comments

Comments
 (0)