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 — Weird PriorityQueue description · Issue #101777 · python/cpython

Weird PriorityQueue description #101777

New issue
Copy link
New issue
Copy link
Closed
#102026
Closed
Weird PriorityQueue description#101777
#102026
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir

Description

@pochmann
pochmann
opened on Feb 10, 2023
Issue body actions

Documentation

Someone asked Does PriorityQueue call sorted every time get is called?. First I laughed, how did they come up with that silly idea, but then I saw they got it from the doc and it really does make it sound like that:

The lowest valued entries are retrieved first (the lowest valued entry is the one returned by sorted(list(entries))[0]).

Not only sorted but also list first, and of course even if the queue didn't use a heap, it should be the straightforward min(entries) instead. This is so over-the-top inefficient and complicated that it looks like a weird joke.

Unless there's good reason for it, I suggest to add "as if" and use min:

The lowest valued entries are retrieved first (the lowest valued entry is the one as if returned by min(entries)).

Linked PRs

  • gh-101777: minor clarification in PriorityQueue docs #102026
  • [3.11] gh-101777: Make PriorityQueue docs slightly clearer (GH-102026) #102106
  • [3.10] gh-101777: Make PriorityQueue docs slightly clearer (GH-102026) #102107
  • GH-101777: queue.rst: use 2 spaces after a period to be consistent. #102143
  • [3.10] GH-101777: queue.rst: use 2 spaces after a period to be consistent. (GH-102143) #102154
  • [3.11] GH-101777: queue.rst: use 2 spaces after a period to be consistent. (GH-102143) #102155

Activity

  1. pochmann
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Feb 10, 2023
  2. ericvsmith commented on Feb 10, 2023

    @ericvsmith
    ericvsmith
    on Feb 10, 2023
    Member
    More actions

    I'm not sure it needs to be changed, but if it must be, then I'd say something like "the one that would be returned by ...".

    Reacted by Owain Davies and Stefan Pochmann
  3. pochmann commented on Feb 10, 2023

    @pochmann
    pochmann
    on Feb 10, 2023
    ContributorAuthor
    More actions

    Yes, that's better.

  4. rhettinger commented on Feb 15, 2023

    @rhettinger
    rhettinger
    on Feb 15, 2023
    Contributor
    More actions

    +1

  5. erlend-aasland
    closed this as completedin #102026on Feb 21, 2023
  6. erlend-aasland
    added a commit that references this issue on Feb 21, 2023

    gh-101777: Make `PriorityQueue` docs slightly clearer (#102026)

    350ba7c
  7. miss-islington
    added 4 commits that reference this issue on Feb 21, 2023

    pythongh-101777: Make `PriorityQueue` docs slightly clearer (pythonGH…

    2f10723

    pythongh-101777: Make `PriorityQueue` docs slightly clearer (pythonGH…

    c30d39c

    gh-101777: Make `PriorityQueue` docs slightly clearer (GH-102026)

    2d9f8d4

    gh-101777: Make `PriorityQueue` docs slightly clearer (GH-102026)

    f94ffcf
  8. rhettinger
    added a commit that references this issue on Feb 22, 2023

    GH-101777: `queue.rst`: use 2 spaces after a period to be consistent. (…

    96bf243
  9. miss-islington
    added 4 commits that reference this issue on Feb 22, 2023

    pythonGH-101777: `queue.rst`: use 2 spaces after a period to be consi…

    a06bfff

    pythonGH-101777: `queue.rst`: use 2 spaces after a period to be consi…

    e0a5936

    GH-101777: `queue.rst`: use 2 spaces after a period to be consistent. (…

    fa592f0

    GH-101777: `queue.rst`: use 2 spaces after a period to be consistent. (…

    8b5498e
  10. carljm
    added a commit that references this issue on Feb 23, 2023

    Merge branch 'main' into lockfreecp

    b257a16
  11. python-sidebar
    added 2 commits that reference this issue on Sep 1, 2024

    pythongh-101777: Make `PriorityQueue` docs slightly clearer (python#1…

    2b46656

    pythongh-101777: Make `PriorityQueue` docs slightly clearer (python#1…

    cb150e2
  12. JelleZijlstra
    added 2 commits that reference this issue on Sep 10, 2024

    pythongh-101777: Make `PriorityQueue` docs slightly clearer (python#1…

    f3816fb

    pythonGH-101777: `queue.rst`: use 2 spaces after a period to be consi…

    d1f00e9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.