]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101777: Make `PriorityQueue` docs slightly clearer (#102026)
authorOwain Davies <116417456+OTheDev@users.noreply.github.com>
Tue, 21 Feb 2023 10:24:33 +0000 (17:24 +0700)
committerGitHub <noreply@github.com>
Tue, 21 Feb 2023 10:24:33 +0000 (11:24 +0100)
Adjust wording slightly, and use min(entries) instead of
sorted(list(entries))[0] as an example.

Doc/library/queue.rst

index c67f15e953bccc97c1eedaf3ec8755f95b067e02..46b8e9b18a3c1f774889544ebcb9028bd202de69 100644 (file)
@@ -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::