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 350ba7c07f)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2023-02-21 02:32:58 -08:00 committed by GitHub
parent 5bc6927c68
commit f94ffcf618
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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::