This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eli.bendersky
Recipients docs@python, eli.bendersky
Date 2015-02-28.16:37:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1425141461.42.0.47354110207.issue23549@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-02-28 16:37:41eli.benderskysetrecipients: + eli.bendersky, docs@python
2015-02-28 16:37:41eli.benderskysetmessageid: <1425141461.42.0.47354110207.issue23549@psf.upfronthosting.co.za>
2015-02-28 16:37:41eli.benderskylinkissue23549 messages
2015-02-28 16:37:41eli.benderskycreate