Type Narrowing: if val == Literal
should always narrow to Literal
#16819
Labels
if val == Literal
should always narrow to Literal
#16819
Feature
Currently mypy already type narrows literals in if
More Complete MyPy Play
Pitch
See #16813 for an example why this is useful.
In general working with TypedDicts in for loop this helps a lot reducing duplicate code / keys.
The text was updated successfully, but these errors were encountered: