You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
List[Literal[...]] type being narrowed where it shouldn't be #9850
Adding an if check on a specific index of a List of Literals seems to narrow down its scope, even though the list can be modified and the value at that index can change.
Activity
tusharsadhwani commentedon Dec 30, 2020
Even doing:
It seems to think that the type of
list[index]can't change once narrowed down.tusharsadhwani commentedon Dec 5, 2021
^ Reproduces on mypy 0.910 as well.