[issue34210] Small improvements in heapq (refatoring)

2018-07-24 Thread Alexander Marshalov
Change by Alexander Marshalov <_...@marshalov.org>: -- keywords: +patch pull_requests: +7965 stage: -> patch review ___ Python tracker ___

[issue34210] Small improvements in heapq (refatoring)

2018-07-24 Thread Alexander Marshalov
New submission from Alexander Marshalov <_...@marshalov.org>: I would like to make three small improvements to the "heapq" module. 1) The "nsmallest" function has the following code (a similar code exists in the "nlargest" function): # When n>=size, it's faster to use sorted() try: