Skip to content
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

gh-101777: minor clarification in PriorityQueue docs #102026

Merged
merged 2 commits into from
Feb 21, 2023
Merged
Changes from all commits
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
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
Copy link
Member

@ericvsmith ericvsmith Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two spaces after the period here are deliberate. Note that elsewhere in this file, periods have two spaces after them. This is used by some editors (including emacs) when a paragraph is re-flowed. I suggest putting this "extra" space back.

PEP 8 mentions this for comments. https://devguide.python.org/documentation/style-guide/ says one or two spaces is acceptable, but in this case I think we should match the rest of the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericvsmith Sorry to break the consistency in the file. Would you like me to open a PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OTheDev : yes, go ahead and open a PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericvsmith There are other instances where there's only one space instead of two after a period in the file. Should I correct those too? :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I beg to differ, @ericvsmith. We do not need to encourage contributors to "fix" one or two spaces after period. There's better use of both contributor time and review time. Also, what has PEP-8 with .rst files to do? AFAICS, nothing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP 8 mentions this for comments.

See python/peps#3024.

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