@@ -2334,7 +2334,7 @@ def f(x: C) -> None:
23342334f(C(5))
23352335[builtins fixtures/primitives.pyi]
23362336
2337- [case testNarrowLiteralsInListOrTupleExpression ]
2337+ [case testNarrowLiteralsInListOrSetOrTupleExpression ]
23382338# flags: --warn-unreachable
23392339
23402340from typing import Optional
@@ -2347,7 +2347,7 @@ def f(v: Optional[Literal[1, 2, 3, 4]]) -> None:
23472347 reveal_type(v) # N: Revealed type is "Union[Literal[1], Literal[2]]"
23482348 elif v in [1]:
23492349 reveal_type(v) # E: Statement is unreachable
2350- elif v is None or v in [ 3, x] :
2350+ elif v is None or v in { 3, x} :
23512351 reveal_type(v) # N: Revealed type is "Union[Literal[3], Literal[4], None]"
23522352 elif v in ():
23532353 reveal_type(v) # E: Statement is unreachable
@@ -2356,7 +2356,7 @@ def f(v: Optional[Literal[1, 2, 3, 4]]) -> None:
23562356 reveal_type(v) # N: Revealed type is "Union[Literal[1], Literal[2], Literal[3], Literal[4], None]"
23572357[builtins fixtures/primitives.pyi]
23582358
2359- [case testNarrowLiteralsNotInListOrTupleExpression ]
2359+ [case testNarrowLiteralsNotInListOrSetOrTupleExpression ]
23602360# flags: --warn-unreachable
23612361
23622362from typing import Optional
@@ -2365,7 +2365,7 @@ from typing_extensions import Literal
23652365x: int
23662366
23672367def f(v: Optional[Literal[1, 2, 3, 4, 5]]) -> None:
2368- if v not in ( 0, 1, 2, 3) :
2368+ if v not in { 0, 1, 2, 3} :
23692369 reveal_type(v) # N: Revealed type is "Union[Literal[4], Literal[5], None]"
23702370 elif v not in [1, 2, 3, 4]: # E: Right operand of "and" is never evaluated
23712371 reveal_type(v) # E: Statement is unreachable
@@ -2378,7 +2378,7 @@ def f(v: Optional[Literal[1, 2, 3, 4, 5]]) -> None:
23782378 reveal_type(v) # N: Revealed type is "Union[Literal[1], Literal[2], Literal[3], Literal[4], Literal[5], None]"
23792379[builtins fixtures/primitives.pyi]
23802380
2381- [case testNarrowEnumsInListOrTupleExpression ]
2381+ [case testNarrowEnumsInListOrSetOrTupleExpression ]
23822382from enum import Enum
23832383from typing import Final
23842384
@@ -2397,7 +2397,7 @@ def f(v: E) -> None:
23972397 reveal_type(v) # N: Revealed type is "Union[Literal[__main__.E.A], Literal[__main__.E.B]]"
23982398 elif v in [E.A]:
23992399 reveal_type(v)
2400- elif v in (C,) :
2400+ elif v in {C} :
24012401 reveal_type(v) # N: Revealed type is "Literal[__main__.E.C]"
24022402 elif v in ():
24032403 reveal_type(v)
@@ -2406,7 +2406,7 @@ def f(v: E) -> None:
24062406 reveal_type(v) # N: Revealed type is "__main__.E"
24072407[builtins fixtures/primitives.pyi]
24082408
2409- [case testNarrowEnumsNotInListOrTupleExpression ]
2409+ [case testNarrowEnumsNotInListOrSetOrTupleExpression ]
24102410from enum import Enum
24112411from typing import Final
24122412
@@ -2426,7 +2426,7 @@ def f(v: E) -> None:
24262426 reveal_type(v) # N: Revealed type is "Union[Literal[__main__.E.D], Literal[__main__.E.E]]"
24272427 elif v not in [E.A, E.B, E.C, E.C]:
24282428 reveal_type(v)
2429- elif v not in (C,) :
2429+ elif v not in {C} :
24302430 reveal_type(v) # N: Revealed type is "Union[Literal[__main__.E.A], Literal[__main__.E.B]]"
24312431 elif v not in []:
24322432 reveal_type(v) # N: Revealed type is "Literal[__main__.E.C]"
0 commit comments