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
heapq docs should be more precise about how to access the smallest element #67737
Comments
The heapq documentation has this paragraph after the doc of nsmallest: The latter two functions perform best for smaller values of n. For larger values, it is more efficient to use the sorted() function. Also, when n==1, it is more efficient to use the built-in min() and max() functions. This is confusing as it suggests to use min() on a heap to find the minimal element. heap[0] is the minimal element, but this is only mentioned at the very top - so you need to read the doc of the entire module to find it. Nothing in the docs of methods suggests it. |
Proposed patch (generated vs. the 3.4 docs) is attached |
“Smalest” is spelt with a double L. |
Good catch. Attaching a new version of the patch with the typo fixed. |
Raymond - gentle ping. Do you see a reason not to check this in? |
New changeset 8ddda7d1f8e3 by Eli Bendersky in branch '3.4': New changeset 642247a536d5 by Eli Bendersky in branch 'default': |
New changeset b61578bb5014 by Eli Bendersky in branch '2.7': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: