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
Should mypy be able to narrow the type here to realize the assignment is okay? While the function may seem odd, this occurs when you have a long alias where the outer type is a union, e.g.:
Example:
mypy reports
error: Unsupported target for indexed assignment ("Union[str, Dict[str, str]]")
.Should mypy be able to narrow the type here to realize the assignment is okay? While the function may seem odd, this occurs when you have a long alias where the outer type is a union, e.g.:
To solve, one can either add an assert/cast or also alias the inner type. But I was surprised mypy didn't do it automatically, so I thought I'd ask.
The text was updated successfully, but these errors were encountered: