8000 gh-101777: minor clarification in `PriorityQueue` docs by OTheDev · Pull Request #102026 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-101777: minor clarification in PriorityQueue docs #102026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use min(entries) rather than sorted(list(entries))[0]
  • Loading branch information
OTheDev committed Feb 20, 2023
commit bc40a6aceeeb86a87cdf88e42df3de14e325e0f9
4 changes: 2 additions & 2 deletions Doc/library/queue.rst
62C7
Original file line number Diff line number Diff line change
Expand Up @@ -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 that would be 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::
Expand Down
0