Union types for dict keys are not inferred in union context #6079
Labels
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
needs discussion
priority-1-normal
topic-join-v-union
Using join vs. using unions
topic-union-types
mypy: 0.650
Python: 3.7.1
I'm not sure if this is a bug or a new feature, however the following code is unexpected (in my mind, especially coming from TypeScript):
I would have expected mypy to infer the type of
d
asbuiltins.dict[Union[builtins.str*, builtins.int*], builtins.int*]
.The text was updated successfully, but these errors were encountered: