You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)).
Activity
ericvsmith commentedon Feb 10, 2023
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 ...".
pochmann commentedon Feb 10, 2023
Yes, that's better.
rhettinger commentedon Feb 15, 2023
+1
gh-101777: Make `PriorityQueue` docs slightly clearer (#102026)
pythongh-101777: Make `PriorityQueue` docs slightly clearer (pythonGH…
pythongh-101777: Make `PriorityQueue` docs slightly clearer (pythonGH…
gh-101777: Make `PriorityQueue` docs slightly clearer (GH-102026)
gh-101777: Make `PriorityQueue` docs slightly clearer (GH-102026)
GH-101777: `queue.rst`: use 2 spaces after a period to be consistent. (…
pythonGH-101777: `queue.rst`: use 2 spaces after a period to be consi…
pythonGH-101777: `queue.rst`: use 2 spaces after a period to be consi…
GH-101777: `queue.rst`: use 2 spaces after a period to be consistent. (…
GH-101777: `queue.rst`: use 2 spaces after a period to be consistent. (…
Merge branch 'main' into lockfreecp
pythongh-101777: Make `PriorityQueue` docs slightly clearer (python#1…
pythongh-101777: Make `PriorityQueue` docs slightly clearer (python#1…
pythongh-101777: Make `PriorityQueue` docs slightly clearer (python#1…
pythonGH-101777: `queue.rst`: use 2 spaces after a period to be consi…