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
I get error: Invalid index type "Union[str, int]" for "Dict[str, str]"; expected type "str" for the print statement (mypy 0.761, python 3.8.0), even though it seems safe to assert within the scope of the if-block that the type of val can only be the intersection of val's type and mapping's keys type.
Is this possible to implement? Are there pitfalls to this pattern that I'm not seeing?
The text was updated successfully, but these errors were encountered:
Given the following code
I get
error: Invalid index type "Union[str, int]" for "Dict[str, str]"; expected type "str"
for the print statement (mypy 0.761, python 3.8.0), even though it seems safe to assert within the scope of the if-block that the type ofval
can only be the intersection ofval
's type andmapping
's keys type.Is this possible to implement? Are there pitfalls to this pattern that I'm not seeing?
The text was updated successfully, but these errors were encountered: