PEP 728: TypedDict with Typed Extra Items

For the functional syntax you can probably re-use the original special casing of treating the dictionary that’s passed in like the body of the class syntax[1], whereas if you add a parameter that is a type, you have to add entirely new special casing and write code to reject invalid values for that specific parameter, since the annotation for the parameter would currently have to be Any.


  1. ignoring valid identifier names ↩︎