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 <>
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/ which wraps the C-function and adds the additional behavior.
Date User Action Args
2014-01-27 15:09:50rhettingersetrecipients: + rhettinger, georg.brandl, larry
2014-01-27 15:09:50rhettingersetmessageid: <>
2014-01-27 15:09:50rhettingerlinkissue20407 messages
2014-01-27 15:09:50rhettingercreate