GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-101777: minor clarification in `PriorityQueue` docs by OTheDev · Pull Request #102026 · python/cpython

Conversation

@OTheDev

@OTheDev OTheDev commented Feb 18, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Tries to fix #101777

  • Issue: Weird PriorityQueue description #101777

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
oda-gitso
fix-101777
e7451b8
@OTheDev
OTheDev requested a review from rhettinger as a code owner February 18, 2023 13:33
@bedevere-bot bedevere-bot added the awaiting review label Feb 18, 2023
@bedevere-bot bedevere-bot mentioned this pull request Feb 18, 2023
Weird PriorityQueue description #101777
Closed
@bedevere-bot bedevere-bot added docs Documentation in the Doc dir skip news labels Feb 18, 2023
Eclips4
Eclips4 approved these changes Feb 18, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Feb 18, 2023
@hauntsaninja hauntsaninja added needs backport to 3.10 needs backport to 3.11 only security fixes labels Feb 19, 2023
hauntsaninja
hauntsaninja approved these changes Feb 19, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Feb 19, 2023
rhettinger
rhettinger approved these changes Feb 19, 2023
View reviewed changes
@lucasalavapena

lucasalavapena commented Feb 19, 2023

Copy link
Copy Markdown

Why not update sorted(list(entries))[0] to min(entries) like pochmann suggested in #101777 ? Might as well do it in this PR, since it is a small change

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@OTheDev
Use min(entries) rather than sorted(list(entries))[0]
bc40a6a
@OTheDev

OTheDev commented Feb 20, 2023

Copy link
Copy Markdown
Contributor Author

@lucasalavapena Sure, I'd be happy to change sorted(list(entries))[0] to min(entries) 👍

Hope that's okay with you too @rhettinger @hauntsaninja @Eclips4!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ghost

ghost commented Feb 20, 2023 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
erlend-aasland merged commit 350ba7c into python:main Feb 21, 2023
@miss-islington

miss-islington commented Feb 21, 2023

Copy link
Copy Markdown
Contributor

Thanks @OTheDev for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label Feb 21, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 21, 2023
@OTheDev @miss-islington
pythongh-101777: Make PriorityQueue docs slightly clearer (pythonGH…
2f10723
…-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 <[email protected]>
@bedevere-bot

bedevere-bot commented Feb 21, 2023

Copy link
Copy Markdown

GH-102106 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Feb 21, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 21, 2023
@OTheDev @miss-islington
pythongh-101777: Make PriorityQueue docs slightly clearer (pythonGH…
c30d39c
…-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 <[email protected]>
@bedevere-bot

bedevere-bot commented Feb 21, 2023

Copy link
Copy Markdown

GH-102107 is a backport of this pull request to the 3.10 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 label Feb 21, 2023
miss-islington added a commit that referenced this pull request Feb 21, 2023
@miss-islington @OTheDev
gh-101777: Make PriorityQueue docs slightly clearer (GH-102026)
2d9f8d4
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 <[email protected]>
miss-islington added a commit that referenced this pull request Feb 21, 2023
@miss-islington @OTheDev
gh-101777: Make PriorityQueue docs slightly clearer (GH-102026)
f94ffcf
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 <[email protected]>
ericvsmith
ericvsmith reviewed Feb 22, 2023
View reviewed changes
Comment thread Doc/library/queue.rst
*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

@ericvsmith ericvsmith Feb 22, 2023 •
edited by AlexWaygood
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with thumbs down emoji
All reactions
  • 👎 1 reaction

@OTheDev OTheDev Feb 22, 2023

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ericvsmith ericvsmith Feb 22, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

OTheDev reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@OTheDev OTheDev Feb 22, 2023

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

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? :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@erlend-aasland erlend-aasland Feb 22, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@erlend-aasland erlend-aasland Feb 22, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@OTheDev OTheDev mentioned this pull request Feb 22, 2023
GH-101777: queue.rst: use 2 spaces after a period to be consistent. #102143
Merged
@erlend-aasland erlend-aasland mentioned this pull request Feb 22, 2023
PEP 8: Consider removing "two spaces after period" python/peps#3024
Closed
carljm added a commit to carljm/cpython that referenced this pull request Feb 23, 2023
@carljm
Merge branch 'main' into lockfreecp
b257a16
* main: (76 commits)
  Fix syntax error in struct doc example (python#102160)
  pythongh-99108: Import MD5 and SHA1 from HACL* (python#102089)
  pythonGH-101777: `queue.rst`: use 2 spaces after a period to be consistent. (python#102143)
  Few coverage nitpicks for the cmath module (python#102067)
  pythonGH-100982: Restrict `FOR_ITER_RANGE` to a single instruction to allow instrumentation. (pythonGH-101985)
  pythongh-102135: Update turtle docs to rename wikipedia demo to rosette (python#102137)
  pythongh-99942: python.pc on android/cygwin should link to libpython per configure.ac (pythonGH-100356)
  pythongh-95672 fix typo SkitTest to SkipTest (pythongh-102119)
  pythongh-101936: Update the default value of fp from io.StringIO to io.BytesIO (pythongh-102100)
  pythongh-102008: simplify test_except_star by using sys.exception() instead of sys.exc_info() (python#102009)
  pythongh-101903: Remove obsolete undefs for previously removed macros Py_EnterRecursiveCall and Py_LeaveRecursiveCall (python#101923)
  pythongh-100556: Improve clarity of `or` docs (python#100589)
  pythongh-101777: Make `PriorityQueue` docs slightly clearer (python#102026)
  pythongh-101965: Fix usage of Py_EnterRecursiveCall return value in _bisectmodule.c (pythonGH-101966)
  pythongh-101578: Amend exception docs (python#102057)
  pythongh-101961 fileinput.hookcompressed should not set the encoding value for the binary mode (pythongh-102068)
  pythongh-102056: Fix a few bugs in error handling of exception printing code (python#102078)
  pythongh-102011: use sys.exception() instead of sys.exc_info() in docs where possible (python#102012)
  pythongh-101566: Sync with zipp 3.14. (pythonGH-102018)
  pythonGH-99818: improve the documentation for zipfile.Path and Traversable (pythonGH-101589)
  ...
python-sidebar pushed a commit to python-sidebar/Python-Documentation-Fork-With-TOC that referenced this pull request Sep 1, 2024
@OTheDev @python-sidebar
pythongh-101777: Make PriorityQueue docs slightly clearer (python#1…
2b46656
…02026)

Adjust wording slightly, and use min(entries) instead of
sorted(list(entries))[0] as an example.
python-sidebar pushed a commit to python-sidebar/Python-Documentation-Fork-With-TOC that referenced this pull request Sep 1, 2024
@OTheDev @python-sidebar
pythongh-101777: Make PriorityQueue docs slightly clearer (python#1…
cb150e2
…02026)

Adjust wording slightly, and use min(entries) instead of
sorted(list(entries))[0] as an example.
JelleZijlstra pushed a commit to JelleZijlstra/cpython that referenced this pull request Sep 10, 2024
@OTheDev @JelleZijlstra
pythongh-101777: Make PriorityQueue docs slightly clearer (python#1…
f3816fb
…02026)

Adjust wording slightly, and use min(entries) instead of
sorted(list(entries))[0] as an example.
@OTheDev
OTheDev deleted the fix-101777 branch January 28, 2025 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ericvsmith ericvsmith ericvsmith left review comments
@erlend-aasland erlend-aasland erlend-aasland left review comments
@rhettinger rhettinger rhettinger approved these changes
@hauntsaninja hauntsaninja hauntsaninja approved these changes
@Eclips4 Eclips4 Eclips4 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Weird PriorityQueue description

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@OTheDev @lucasalavapena @miss-islington @bedevere-bot @ericvsmith @rhettinger @hauntsaninja @erlend-aasland @Eclips4
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.