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
A dict(**component_a, **component_b) does not type match with a type AB, where component_a : A, component_b: B, and class AB(A, B), and types A & B are simple TypedDicts
To Reproduce
fromtypingimportTypedDictclassA(TypedDict):
field1: strfield2: strclassB(TypedDict):
field3: strfield4: strclassAB(A, B):
passdefget_thing(a: A, b: B) ->AB:
returndict(**a, **b)
Expected Behavior Success: no issues found in 1 source file
Actual Behavior foo.py:15: error: Incompatible return value type (got "Dict[str, str]", expected "AB")
Your Environment
mypy 0.961 (compiled: yes)
default config for mypy
Python 3.9.10
Darwin Vincents-MacBook-Pro 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 x86_64
The text was updated successfully, but these errors were encountered:
Bug Report
A
dict(**component_a, **component_b)
does not type match with a typeAB
, wherecomponent_a : A
,component_b: B
, andclass AB(A, B)
, and types A & B are simpleTypedDict
sTo Reproduce
Expected Behavior
Success: no issues found in 1 source file
Actual Behavior
foo.py:15: error: Incompatible return value type (got "Dict[str, str]", expected "AB")
Your Environment
mypy 0.961 (compiled: yes)
default config for mypy
Python 3.9.10
Darwin Vincents-MacBook-Pro 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 x86_64
The text was updated successfully, but these errors were encountered: