Skip to content

Commit d4f406b

Browse files
committed
Switch to from-imports
1 parent 6932490 commit d4f406b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/collections/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828

2929
import _collections_abc
3030
import sys as _sys
31-
lazy import copy as _copy
32-
lazy import heapq as _heapq
3331

3432
_sys.modules['collections.abc'] = _collections_abc
3533
abc = _collections_abc
3634

35+
lazy from copy import copy as _copy
36+
lazy from heapq import nlargest as _nlargest
3737
from itertools import chain as _chain
3838
from itertools import repeat as _repeat
3939
from itertools import starmap as _starmap
@@ -634,7 +634,7 @@ def most_common(self, n=None):
634634
if n is None:
635635
return sorted(self.items(), key=_itemgetter(1), reverse=True)
636636

637-
return _heapq.nlargest(n, self.items(), key=_itemgetter(1))
637+
return _nlargest(n, self.items(), key=_itemgetter(1))
638638

639639
def elements(self):
640640
'''Iterator over elements repeating each as many times as its count.
@@ -1247,7 +1247,7 @@ def copy(self):
12471247
data = self.data
12481248
try:
12491249
self.data = {}
1250-
c = _copy.copy(self)
1250+
c = _copy(self)
12511251
finally:
12521252
self.data = data
12531253
c.update(self)

0 commit comments

Comments
 (0)