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 rhettinger
Recipients georg.brandl, larry, rhettinger
Date 2014-01-27.15:09:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390835390.68.0.102570831271.issue20407@psf.upfronthosting.co.za>
In-reply-to
Content
The docs are correct as-is.  This is a documented and tested behavior.

    >>> from heapq import nsmallest
    >>> list(nsmallest(3, ['larry', 'georg', 'raymond', 'guido', 'tim'], key=len))
    ['tim', 'larry', 'georg']

The C implementation doesn't have a key-argument.  That behavior gets added downstream in pure python in Lib/heapq.py which wraps the C-function and adds the additional behavior.
History
Date User Action Args
2014-01-27 15:09:50rhettingersetrecipients: + rhettinger, georg.brandl, larry
2014-01-27 15:09:50rhettingersetmessageid: <1390835390.68.0.102570831271.issue20407@psf.upfronthosting.co.za>
2014-01-27 15:09:50rhettingerlinkissue20407 messages
2014-01-27 15:09:50rhettingercreate