Skip to content

Commit

Permalink
pythongh-101777: Make PriorityQueue docs slightly clearer (pythonGH…
Browse files Browse the repository at this point in the history
…-102026)

Adjust wording slightly, and use min(entries) instead of
sorted(list(entries))[0] as an example.
(cherry picked from commit 350ba7c)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
  • Loading branch information
OTheDev authored and miss-islington committed Feb 21, 2023
1 parent d9dce23 commit c30d39c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/library/queue.rst
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 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 comments on commit c30d39c

Please sign in to comment.