I have the following code when trying to spread the dictionary from typing import TypedDict
class MyDict(TypedDict):
foo: int
def test(inp: MyDict):
m: MyDict = inp # OK
n: MyDict = {**inp} # <-- ERROR
I receive an error Expression of type "dict[str, object]" cannot be assigned to declared type
Any idea how can I preserve the type after spread?