Skip to content

Commit f228a84

Browse files
committed
Revert collections module
1 parent d648fc8 commit f228a84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/collections/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from operator import itemgetter as _itemgetter, eq as _eq
2727
from keyword import iskeyword as _iskeyword
2828
import sys as _sys
29+
import heapq as _heapq
2930
from _weakref import proxy as _proxy
3031
from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
3132
from reprlib import recursive_repr as _recursive_repr
@@ -556,8 +557,7 @@ def most_common(self, n=None):
556557
# Emulate Bag.sortedByCount from Smalltalk
557558
if n is None:
558559
return sorted(self.items(), key=_itemgetter(1), reverse=True)
559-
import heapq
560-
return heapq.nlargest(n, self.items(), key=_itemgetter(1))
560+
return _heapq.nlargest(n, self.items(), key=_itemgetter(1))
561561

562562
def elements(self):
563563
'''Iterator over elements repeating each as many times as its count.

0 commit comments

Comments
 (0)