Open
Description
Bug Report
Cannot use dict expansion in TypedDict constructor. Why?
To Reproduce
from typing import TypedDict
class SomeTypedDict(TypedDict):
field1: str
field2: int
field3: bool
SOME_SAMPLE = {
'field1': 'str',
'field2': 0,
'field3': True,
}
some_variable = SomeTypedDict(**SOME_SAMPLE)
print(some_variable)
Actual Behavior
user@pc:~/$ mypy main.py
main.py:16: error: Unsupported type "dict[str, object]" for ** expansion in TypedDict [typeddict-item]
Found 1 error in 1 file (checked 1 source file)
Your Environment
user@pc:~/$ mypy --version
mypy 1.8.0 (compiled: yes)
user@pc:~/$ python3 --version
Python 3.12.0