@@ -18,7 +18,7 @@ if int():
1818
1919[case testEnumCreatedFromStringLiteral]
2020from enum import Enum
21- from typing_extensions import Literal
21+ from typing import Literal
2222
2323x: Literal['ANT BEE CAT DOG'] = 'ANT BEE CAT DOG'
2424Animal = Enum('Animal', x)
@@ -181,7 +181,7 @@ def infer_truth(truth: Truth) -> None:
181181[case testEnumTruthyness]
182182# mypy: warn-unreachable
183183import enum
184- from typing_extensions import Literal
184+ from typing import Literal
185185
186186class E(enum.Enum):
187187 zero = 0
@@ -213,7 +213,7 @@ def main(zero: Literal[E.zero], one: Literal[E.one]) -> None:
213213[case testEnumTruthynessCustomDunderBool]
214214# mypy: warn-unreachable
215215import enum
216- from typing_extensions import Literal
216+ from typing import Literal
217217
218218class E(enum.Enum):
219219 zero = 0
@@ -247,7 +247,7 @@ def main(zero: Literal[E.zero], one: Literal[E.one]) -> None:
247247[case testEnumTruthynessStrEnum]
248248# mypy: warn-unreachable
249249import enum
250- from typing_extensions import Literal
250+ from typing import Literal
251251
252252class E(enum.StrEnum):
253253 empty = ""
@@ -726,7 +726,7 @@ reveal_type(Test.a) # N: Revealed type is "Literal[__main__.Test.a]?"
726726
727727[case testEnumAttributeAccessMatrix]
728728from enum import Enum, IntEnum, IntFlag, Flag, EnumMeta, auto
729- from typing_extensions import Literal
729+ from typing import Literal
730730
731731def is_x(val: Literal['x']) -> None: pass
732732
@@ -872,7 +872,7 @@ main:2: note: Revealed type is "Literal['foo']?"
872872
873873[case testEnumReachabilityChecksBasic]
874874from enum import Enum
875- from typing_extensions import Literal
875+ from typing import Literal
876876
877877class Foo(Enum):
878878 A = 1
@@ -924,7 +924,7 @@ reveal_type(y) # N: Revealed type is "__main__.Foo"
924924
925925[case testEnumReachabilityChecksWithOrdering]
926926from enum import Enum
927- from typing_extensions import Literal
927+ from typing import Literal
928928
929929class Foo(Enum):
930930 _order_ = "A B"
@@ -975,7 +975,8 @@ else:
975975
976976[case testEnumReachabilityChecksIndirect]
977977from enum import Enum
978- from typing_extensions import Literal, Final
978+ from typing import Literal
979+ from typing_extensions import Final
979980
980981class Foo(Enum):
981982 A = 1
@@ -1040,7 +1041,7 @@ else:
10401041
10411042[case testEnumReachabilityNoNarrowingForUnionMessiness]
10421043from enum import Enum
1043- from typing_extensions import Literal
1044+ from typing import Literal
10441045
10451046class Foo(Enum):
10461047 A = 1
@@ -1096,8 +1097,7 @@ reveal_type(x) # N: Revealed type is "Union[__main__.Foo, None]"
10961097
10971098[case testEnumReachabilityWithMultipleEnums]
10981099from enum import Enum
1099- from typing import Union
1100- from typing_extensions import Literal
1100+ from typing import Literal, Union
11011101
11021102class Foo(Enum):
11031103 A = 1
@@ -1331,7 +1331,8 @@ reveal_type(x) # N: Revealed type is "__main__.Foo"
13311331[case testEnumReachabilityWithChainingDirectConflict]
13321332# flags: --warn-unreachable
13331333from enum import Enum
1334- from typing_extensions import Literal, Final
1334+ from typing import Literal
1335+ from typing_extensions import Final
13351336
13361337class Foo(Enum):
13371338 A = 1
@@ -1366,7 +1367,8 @@ reveal_type(x) # N: Revealed type is "__main__.Foo"
13661367[case testEnumReachabilityWithChainingBigDisjoints]
13671368# flags: --warn-unreachable
13681369from enum import Enum
1369- from typing_extensions import Literal, Final
1370+ from typing import Literal
1371+ from typing_extensions import Final
13701372
13711373class Foo(Enum):
13721374 A = 1
@@ -1488,8 +1490,7 @@ reveal_type(a._value_) # N: Revealed type is "Any"
14881490# as the full type, regardless of the amount of elements
14891491# the enum contains.
14901492from enum import Enum
1491- from typing import Union
1492- from typing_extensions import Literal
1493+ from typing import Literal, Union
14931494
14941495class Foo(Enum):
14951496 A = 1
@@ -1507,7 +1508,7 @@ def f(x: Foo):
15071508
15081509[case testEnumTypeCompatibleWithLiteralUnion]
15091510from enum import Enum
1510- from typing_extensions import Literal
1511+ from typing import Literal
15111512
15121513class E(Enum):
15131514 A = 1
0 commit comments