Skip to content

Commit 97bde75

Browse files
committed
Lazily import itertools
1 parent ba0aca3 commit 97bde75

53 files changed

Lines changed: 57 additions & 57 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Lib/_pydecimal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6279,7 +6279,7 @@ def _group_lengths(grouping):
62796279
# (2) nonempty list of positive integers + [0]
62806280
# (3) list of positive integers + [locale.CHAR_MAX], or
62816281

6282-
from itertools import chain, repeat
6282+
lazy from itertools import chain, repeat
62836283
if not grouping:
62846284
return []
62856285
elif grouping[-1] == 0 and len(grouping) >= 2:

Lib/_pylong.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ def inner(w):
721721
exp = compute_powers(w, 1, limit, need_hi=need_hi)
722722
assert exp.keys() == need
723723

724-
from itertools import chain
724+
lazy from itertools import chain
725725
for need_hi in (False, True):
726726
for limit in (0, 1, 10, 100, 1_000, 10_000, 100_000):
727727
for w in chain(range(1, 100_000),

Lib/_pyrepl/_module_completer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from io import StringIO
1212
from contextlib import contextmanager
1313
from dataclasses import dataclass
14-
from itertools import chain
14+
lazy from itertools import chain
1515
from tokenize import TokenInfo
1616
from .fancycompleter import safe_getattr
1717

Lib/asyncio/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Tools to analyze tasks running in asyncio programs."""
22

33
from collections import defaultdict
4-
from itertools import count
4+
lazy from itertools import count
55
from enum import Enum
66
import sys
77
from _remote_debugging import RemoteUnwinder, FrameInfo

Lib/calendar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import datetime
1010
from enum import IntEnum, global_enum
1111
import locale as _locale
12-
from itertools import repeat
12+
lazy from itertools import repeat
1313

1414
__all__ = ["IllegalMonthError", "IllegalWeekdayError", "setfirstweekday",
1515
"firstweekday", "isleap", "leapdays", "weekday", "monthrange",

Lib/collections/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434

3535
lazy from copy import copy as _copy
3636
lazy from heapq import nlargest as _nlargest
37-
from itertools import chain as _chain
38-
from itertools import repeat as _repeat
39-
from itertools import starmap as _starmap
37+
lazy from itertools import chain as _chain
38+
lazy from itertools import repeat as _repeat
39+
lazy from itertools import starmap as _starmap
4040
from keyword import iskeyword as _iskeyword
4141
from operator import eq as _eq
4242
from operator import itemgetter as _itemgetter

Lib/concurrent/futures/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import time
1010
import types
1111
import weakref
12-
from itertools import islice
12+
lazy from itertools import islice
1313

1414
FIRST_COMPLETED = 'FIRST_COMPLETED'
1515
FIRST_EXCEPTION = 'FIRST_EXCEPTION'

Lib/ctypes/macholib/dyld.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
from ctypes.macholib.framework import framework_info
77
from ctypes.macholib.dylib import dylib_info
8-
from itertools import *
8+
lazy from itertools import *
99
try:
1010
from _ctypes import _dyld_shared_cache_contains_path
1111
except ImportError:

Lib/filecmp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import os
1414
import stat
15-
from itertools import filterfalse
15+
lazy from itertools import filterfalse
1616
from types import GenericAlias
1717

1818
__all__ = ['clear_cache', 'cmp', 'dircmp', 'cmpfiles', 'DEFAULT_IGNORES']

Lib/idlelib/idle_test/test_sidebar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from textwrap import dedent
33
import sys
44

5-
from itertools import chain
5+
lazy from itertools import chain
66
import unittest
77
import unittest.mock
88
from test.support import requires, swap_attr

0 commit comments

Comments
 (0)