@@ -2090,7 +2090,7 @@ if isinstance(x, (Z, NoneType)): # E: Subclass of "X" and "Z" cannot exist: "Z"
20902090
20912091[builtins fixtures/isinstance.pyi]
20922092
2093- [case testNarrowLiteralsInTupleExpression ]
2093+ [case testNarrowLiteralsInListOrTupleExpression ]
20942094# flags: --warn-unreachable
20952095
20962096from typing import Optional
@@ -2101,9 +2101,9 @@ x: int
21012101def f(v: Optional[Literal[1, 2, 3, 4]]) -> None:
21022102 if v in (0, 1, 2):
21032103 reveal_type(v) # N: Revealed type is "Union[Literal[1], Literal[2]]"
2104- elif v in (1,) :
2104+ elif v in [1] :
21052105 reveal_type(v) # E: Statement is unreachable
2106- elif v is None or v in ( 3, x) :
2106+ elif v is None or v in [ 3, x] :
21072107 reveal_type(v) # N: Revealed type is "Union[Literal[3], Literal[4], None]"
21082108 elif v in ():
21092109 reveal_type(v) # E: Statement is unreachable
@@ -2112,7 +2112,7 @@ def f(v: Optional[Literal[1, 2, 3, 4]]) -> None:
21122112 reveal_type(v) # N: Revealed type is "Union[Literal[1], Literal[2], Literal[3], Literal[4], None]"
21132113[builtins fixtures/primitives.pyi]
21142114
2115- [case testNarrowLiteralsNotInTupleExpression ]
2115+ [case testNarrowLiteralsNotInListOrTupleExpression ]
21162116# flags: --warn-unreachable
21172117
21182118from typing import Optional
@@ -2123,7 +2123,7 @@ x: int
21232123def f(v: Optional[Literal[1, 2, 3, 4, 5]]) -> None:
21242124 if v not in (0, 1, 2, 3):
21252125 reveal_type(v) # N: Revealed type is "Union[Literal[4], Literal[5], None]"
2126- elif v not in ( 1, 2, 3, 4) : # E: Right operand of "and" is never evaluated
2126+ elif v not in [ 1, 2, 3, 4] : # E: Right operand of "and" is never evaluated
21272127 reveal_type(v) # E: Statement is unreachable
21282128 elif v is not None and v not in (3,):
21292129 reveal_type(v) # N: Revealed type is "Union[Literal[1], Literal[2]]"
@@ -2134,7 +2134,7 @@ def f(v: Optional[Literal[1, 2, 3, 4, 5]]) -> None:
21342134 reveal_type(v) # N: Revealed type is "Union[Literal[1], Literal[2], Literal[3], Literal[4], Literal[5], None]"
21352135[builtins fixtures/primitives.pyi]
21362136
2137- [case testNarrowEnumsInTupleExpression ]
2137+ [case testNarrowEnumsInListOrTupleExpression ]
21382138from enum import Enum
21392139from typing import Final
21402140
@@ -2151,7 +2151,7 @@ def f(v: E) -> None:
21512151 reveal_type(v) # N: Revealed type is "__main__.E"
21522152 if v in (A, E.B):
21532153 reveal_type(v) # N: Revealed type is "Union[Literal[__main__.E.A], Literal[__main__.E.B]]"
2154- elif v in ( E.A,) :
2154+ elif v in [ E.A] :
21552155 reveal_type(v)
21562156 elif v in (C,):
21572157 reveal_type(v) # N: Revealed type is "Literal[__main__.E.C]"
@@ -2162,7 +2162,7 @@ def f(v: E) -> None:
21622162 reveal_type(v) # N: Revealed type is "__main__.E"
21632163[builtins fixtures/primitives.pyi]
21642164
2165- [case testNarrowEnumsNotInTupleExpression ]
2165+ [case testNarrowEnumsNotInListOrTupleExpression ]
21662166from enum import Enum
21672167from typing import Final
21682168
@@ -2180,11 +2180,11 @@ def f(v: E) -> None:
21802180 reveal_type(v) # N: Revealed type is "__main__.E"
21812181 if v not in (A, E.B, E.C):
21822182 reveal_type(v) # N: Revealed type is "Union[Literal[__main__.E.D], Literal[__main__.E.E]]"
2183- elif v not in ( E.A, E.B, E.C, E.C) :
2183+ elif v not in [ E.A, E.B, E.C, E.C] :
21842184 reveal_type(v)
21852185 elif v not in (C,):
21862186 reveal_type(v) # N: Revealed type is "Union[Literal[__main__.E.A], Literal[__main__.E.B]]"
2187- elif v not in () :
2187+ elif v not in [] :
21882188 reveal_type(v) # N: Revealed type is "Literal[__main__.E.C]"
21892189 else:
21902190 reveal_type(v)
0 commit comments