Skip to content

Commit 9c1406c

Browse files
authored
Update imports after dropping Python 3.9 (#20322)
Ref: #20154
1 parent ece4d41 commit 9c1406c

Some content is hidden

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

78 files changed

+166
-142
lines changed

misc/analyze_cache.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import os.path
88
from collections import Counter
99
from collections.abc import Iterable
10-
from typing import Any, Final
11-
from typing_extensions import TypeAlias as _TypeAlias
10+
from typing import Any, Final, TypeAlias as _TypeAlias
1211

1312
ROOT: Final = ".mypy_cache/3.5"
1413

misc/incremental_checker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
import textwrap
4545
import time
4646
from argparse import ArgumentParser, Namespace, RawDescriptionHelpFormatter
47-
from typing import Any, Final
48-
from typing_extensions import TypeAlias as _TypeAlias
47+
from typing import Any, Final, TypeAlias as _TypeAlias
4948

5049
CACHE_PATH: Final = ".incremental_checker_cache.json"
5150
MYPY_REPO_URL: Final = "https://github.com/python/mypy.git"

misc/perf_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import subprocess
99
import textwrap
1010
import time
11-
from typing import Callable
11+
from collections.abc import Callable
1212

1313

1414
class Command:

mypy/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@
4646
from __future__ import annotations
4747

4848
import sys
49+
from collections.abc import Callable
4950
from io import StringIO
50-
from typing import Callable, TextIO
51+
from typing import TextIO
5152

5253

5354
def _run(main_wrapper: Callable[[TextIO, TextIO], None]) -> tuple[str, str, int]:

mypy/applytype.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

3-
from collections.abc import Iterable, Sequence
4-
from typing import Callable
3+
from collections.abc import Callable, Iterable, Sequence
54

65
import mypy.subtypes
76
from mypy.erasetype import erase_typevars

mypy/argmap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from __future__ import annotations
44

5-
from collections.abc import Sequence
6-
from typing import TYPE_CHECKING, Callable
5+
from collections.abc import Callable, Sequence
6+
from typing import TYPE_CHECKING
77

88
from mypy import nodes
99
from mypy.maptype import map_instance_to_supertype

mypy/binder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
from collections import defaultdict
44
from collections.abc import Iterator
55
from contextlib import contextmanager
6-
from typing import NamedTuple
7-
from typing_extensions import TypeAlias as _TypeAlias
6+
from typing import NamedTuple, TypeAlias as _TypeAlias
87

98
from mypy.erasetype import remove_instance_last_known_values
109
from mypy.literals import Key, extract_var_from_literal_hash, literal, literal_hash, subkeys

mypy/build.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,17 @@
2424
import sys
2525
import time
2626
import types
27-
from collections.abc import Iterator, Mapping, Sequence, Set as AbstractSet
28-
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Final, NoReturn, TextIO, TypedDict
29-
from typing_extensions import TypeAlias as _TypeAlias
27+
from collections.abc import Callable, Iterator, Mapping, Sequence, Set as AbstractSet
28+
from typing import (
29+
TYPE_CHECKING,
30+
Any,
31+
ClassVar,
32+
Final,
33+
NoReturn,
34+
TextIO,
35+
TypeAlias as _TypeAlias,
36+
TypedDict,
37+
)
3038

3139
from librt.internal import cache_version
3240

mypy/cache.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@
4848
from __future__ import annotations
4949

5050
from collections.abc import Sequence
51-
from typing import Any, Final
52-
from typing_extensions import TypeAlias as _TypeAlias
51+
from typing import Any, Final, TypeAlias as _TypeAlias
5352

5453
from librt.internal import (
5554
ReadBuffer as ReadBuffer,

mypy/checker.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@
44

55
import itertools
66
from collections import defaultdict
7-
from collections.abc import Iterable, Iterator, Mapping, Sequence, Set as AbstractSet
7+
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence, Set as AbstractSet
88
from contextlib import ExitStack, contextmanager
9-
from typing import Callable, Final, Generic, Literal, NamedTuple, TypeVar, cast, overload
10-
from typing_extensions import TypeAlias as _TypeAlias, TypeGuard
9+
from typing import (
10+
Final,
11+
Generic,
12+
Literal,
13+
NamedTuple,
14+
TypeAlias as _TypeAlias,
15+
TypeGuard,
16+
TypeVar,
17+
cast,
18+
overload,
19+
)
1120

1221
import mypy.checkexpr
1322
from mypy import errorcodes as codes, join, message_registry, nodes, operators

0 commit comments

Comments
 (0)