Dictionary unpacking of a TypedDict yields incorrect Dict[str, object]
type
#1328
Labels
enhancement
New feature or request
fixed in next version (main)
A fix has been implemented and will appear in an upcoming version
Environment data
Snippet
Expected behaviour
function(**my_configs)
should pass the type checkconfigs_copy = {**my_configs}
should either have an inferred type ofDict[str, Union[int, str]]
orDict[str, Any]
, or at leastDict[str, Unknown]
my_configs.values()
should, same as above, have at leastValuesView[Unknown]
inferred typeActual behaviour
function(**my_configs)
fails to type check with the following message:configs_copy = {**my_configs}
has an inferred type ofDict[str, object]
my_configs.values()
is inferred asValuesView[object]
Other info
This type of TypedDict unpacking was working before, though not inferring the types of the keys of the dictionary. However, we can agree that unpacking a TypedDict should not yield an
object
type.Work on this bug could end up fulfilling (at least partially) this feature request I did some time ago #374
The text was updated successfully, but these errors were encountered: