[issue5669] Extra heapq nlargest/nsmallest option for including ties
report at bugs.python.org
Thu Apr 2 21:07:54 CEST 2009
George Sakkis <george.sakkis at gmail.com> added the comment:
> That should have been: last = result[-1]; [last]*s.count(last).
Nice, though that's not equivalent if the objects' identity is
significant for what happens next (which typically is the case when ties
are preserved). The sorted/bisect solution doesn't have this problem.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list