@@ -18,7 +18,7 @@ if int():
18
18
19
19
[case testEnumCreatedFromStringLiteral]
20
20
from enum import Enum
21
- from typing_extensions import Literal
21
+ from typing import Literal
22
22
23
23
x: Literal['ANT BEE CAT DOG'] = 'ANT BEE CAT DOG'
24
24
Animal = Enum('Animal', x)
@@ -181,7 +181,7 @@ def infer_truth(truth: Truth) -> None:
181
181
[case testEnumTruthyness]
182
182
# mypy: warn-unreachable
183
183
import enum
184
- from typing_extensions import Literal
184
+ from typing import Literal
185
185
186
186
class E(enum.Enum):
187
187
zero = 0
@@ -213,7 +213,7 @@ def main(zero: Literal[E.zero], one: Literal[E.one]) -> None:
213
213
[case testEnumTruthynessCustomDunderBool]
214
214
# mypy: warn-unreachable
215
215
import enum
216
- from typing_extensions import Literal
216
+ from typing import Literal
217
217
218
218
class E(enum.Enum):
219
219
zero = 0
@@ -247,7 +247,7 @@ def main(zero: Literal[E.zero], one: Literal[E.one]) -> None:
247
247
[case testEnumTruthynessStrEnum]
248
248
# mypy: warn-unreachable
249
249
import enum
250
- from typing_extensions import Literal
250
+ from typing import Literal
251
251
252
252
class E(enum.StrEnum):
253
253
empty = ""
@@ -726,7 +726,7 @@ reveal_type(Test.a) # N: Revealed type is "Literal[__main__.Test.a]?"
726
726
727
727
[case testEnumAttributeAccessMatrix]
728
728
from enum import Enum, IntEnum, IntFlag, Flag, EnumMeta, auto
729
- from typing_extensions import Literal
729
+ from typing import Literal
730
730
731
731
def is_x(val: Literal['x']) -> None: pass
732
732
@@ -872,7 +872,7 @@ main:2: note: Revealed type is "Literal['foo']?"
872
872
873
873
[case testEnumReachabilityChecksBasic]
874
874
from enum import Enum
875
- from typing_extensions import Literal
875
+ from typing import Literal
876
876
877
877
class Foo(Enum):
878
878
A = 1
@@ -924,7 +924,7 @@ reveal_type(y) # N: Revealed type is "__main__.Foo"
924
924
925
925
[case testEnumReachabilityChecksWithOrdering]
926
926
from enum import Enum
927
- from typing_extensions import Literal
927
+ from typing import Literal
928
928
929
929
class Foo(Enum):
930
930
_order_ = "A B"
@@ -975,7 +975,8 @@ else:
975
975
976
976
[case testEnumReachabilityChecksIndirect]
977
977
from enum import Enum
978
- from typing_extensions import Literal, Final
978
+ from typing import Literal
979
+ from typing_extensions import Final
979
980
980
981
class Foo(Enum):
981
982
A = 1
@@ -1040,7 +1041,7 @@ else:
1040
1041
1041
1042
[case testEnumReachabilityNoNarrowingForUnionMessiness]
1042
1043
from enum import Enum
1043
- from typing_extensions import Literal
1044
+ from typing import Literal
1044
1045
1045
1046
class Foo(Enum):
1046
1047
A = 1
@@ -1096,8 +1097,7 @@ reveal_type(x) # N: Revealed type is "Union[__main__.Foo, None]"
1096
1097
1097
1098
[case testEnumReachabilityWithMultipleEnums]
1098
1099
from enum import Enum
1099
- from typing import Union
1100
- from typing_extensions import Literal
1100
+ from typing import Literal, Union
1101
1101
1102
1102
class Foo(Enum):
1103
1103
A = 1
@@ -1331,7 +1331,8 @@ reveal_type(x) # N: Revealed type is "__main__.Foo"
1331
1331
[case testEnumReachabilityWithChainingDirectConflict]
1332
1332
# flags: --warn-unreachable
1333
1333
from enum import Enum
1334
- from typing_extensions import Literal, Final
1334
+ from typing import Literal
1335
+ from typing_extensions import Final
1335
1336
1336
1337
class Foo(Enum):
1337
1338
A = 1
@@ -1366,7 +1367,8 @@ reveal_type(x) # N: Revealed type is "__main__.Foo"
1366
1367
[case testEnumReachabilityWithChainingBigDisjoints]
1367
1368
# flags: --warn-unreachable
1368
1369
from enum import Enum
1369
- from typing_extensions import Literal, Final
1370
+ from typing import Literal
1371
+ from typing_extensions import Final
1370
1372
1371
1373
class Foo(Enum):
1372
1374
A = 1
@@ -1488,8 +1490,7 @@ reveal_type(a._value_) # N: Revealed type is "Any"
1488
1490
# as the full type, regardless of the amount of elements
1489
1491
# the enum contains.
1490
1492
from enum import Enum
1491
- from typing import Union
1492
- from typing_extensions import Literal
1493
+ from typing import Literal, Union
1493
1494
1494
1495
class Foo(Enum):
1495
1496
A = 1
@@ -1507,7 +1508,7 @@ def f(x: Foo):
1507
1508
1508
1509
[case testEnumTypeCompatibleWithLiteralUnion]
1509
1510
from enum import Enum
1510
- from typing_extensions import Literal
1511
+ from typing import Literal
1511
1512
1512
1513
class E(Enum):
1513
1514
A = 1
0 commit comments