Skip to content

Commit 1b471a9

Browse files
authored
Update typing_extensions imports in infrastructure and tests (#11243)
1 parent 87a695a commit 1b471a9

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

test_cases/stdlib/builtins/check_pow.py

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

33
from decimal import Decimal
44
from fractions import Fraction
5-
from typing import Any
6-
from typing_extensions import Literal, assert_type
5+
from typing import Any, Literal
6+
from typing_extensions import assert_type
77

88
# See #7163
99
assert_type(pow(1, 0), Literal[1])

test_cases/stdlib/builtins/check_sum.py

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

3-
from typing import Any, List, Union
4-
from typing_extensions import Literal, assert_type
3+
from typing import Any, List, Literal, Union
4+
from typing_extensions import assert_type
55

66

77
class Foo:

test_cases/stdlib/check_enum.py

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

33
import enum
44
import sys
5-
from typing import Type
6-
from typing_extensions import Literal, assert_type
5+
from typing import Literal, Type
6+
from typing_extensions import assert_type
77

88
A = enum.Enum("A", "spam eggs bacon")
99
B = enum.Enum("B", ["spam", "eggs", "bacon"])

test_cases/stdlib/check_unittest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from datetime import datetime, timedelta
66
from decimal import Decimal
77
from fractions import Fraction
8-
from typing_extensions import TypedDict, assert_type
8+
from typing import TypedDict
9+
from typing_extensions import assert_type
910
from unittest.mock import MagicMock, Mock, patch
1011

1112
case = unittest.TestCase()

test_cases/stdlib/itertools/check_itertools_recipes.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,22 @@
1010
import operator
1111
import sys
1212
from itertools import chain, combinations, count, cycle, filterfalse, groupby, islice, product, repeat, starmap, tee, zip_longest
13-
from typing import Any, Callable, Collection, Hashable, Iterable, Iterator, Sequence, Tuple, Type, TypeVar, Union, overload
14-
from typing_extensions import Literal, TypeAlias, TypeVarTuple, Unpack
13+
from typing import (
14+
Any,
15+
Callable,
16+
Collection,
17+
Hashable,
18+
Iterable,
19+
Iterator,
20+
Literal,
21+
Sequence,
22+
Tuple,
23+
Type,
24+
TypeVar,
25+
Union,
26+
overload,
27+
)
28+
from typing_extensions import TypeAlias, TypeVarTuple, Unpack
1529

1630
_T = TypeVar("_T")
1731
_T1 = TypeVar("_T1")

tests/parse_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from collections.abc import Mapping
1111
from dataclasses import dataclass
1212
from pathlib import Path
13-
from typing import NamedTuple
14-
from typing_extensions import Annotated, Final, TypeGuard, final
13+
from typing import Final, NamedTuple, final
14+
from typing_extensions import Annotated, TypeGuard
1515

1616
import tomli
1717
from packaging.requirements import Requirement

0 commit comments

Comments
 (0)