[issue16098] Bisect optimization in heapq.nsmallest is never used

2012-10-04 Thread Will Haldean Brown
Will Haldean Brown added the comment: Thanks for the clarification Raymond! -- resolution: -> invalid status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue16098] Bisect optimization in heapq.nsmallest is never used

2012-10-01 Thread Will Haldean Brown
New submission from Will Haldean Brown: The implementation of nsmallest in heapq contains an optimization for when n is an order of magnitude less than the size of the data, which uses bisect to find the n-smallest elements. This optimization is guarded by a check to ensure that the data