-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codeneeds discussionpriority-1-normaltopic-join-v-unionUsing join vs. using unionsUsing join vs. using unionstopic-union-types
Description
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):
d = {"1": 2, 3: 4}
reveal_type(d) # builtins.dict[builtins.object*, builtins.int*]I would have expected mypy to infer the type of d as builtins.dict[Union[builtins.str*, builtins.int*], builtins.int*].
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codeneeds discussionpriority-1-normaltopic-join-v-unionUsing join vs. using unionsUsing join vs. using unionstopic-union-types