ty
ty copied to clipboard
Unpacking a typed dictionary into another should transfer defined keys.
Summary
from typing import TypedDict
class MyTypedDict1(TypedDict):
aaa: int
bbb: int
class MyTypedDict2(TypedDict):
aaa: int
bbb: int
ccc: int
d1: MyTypedDict1 = {
"aaa": 1,
"bbb": 2,
}
d2: MyTypedDict2 = {
**d1,
"ccc": 3,
}
Missing required key 'aaa' in TypedDict
MyTypedDict2constructor (missing-typed-dict-key) [Ln 18, Col 20] Missing required key 'bbb' in TypedDictMyTypedDict2constructor (missing-typed-dict-key) [Ln 18, Col 20]
https://play.ty.dev/5bf7c51c-fb7d-4a32-8fc3-799f1e014d76
Version
0.0.1a25