
March 13, 2022
1:34 p.m.
I agree with Jelle. If there's no way to specify the type of the extra fields, then I don't think we would gain value from this PEP. You mentioned that the use of `__extra__` would lead to an ambiguity. The purpose of a specification is to remove such ambiguities, so I don't think it would be ambiguous. It would preclude the use of a TypedDict with an actual key named `__extra__`. Dundered names are supposed to be reserved for stdlib functionality, so using such a name as a key in your TypedDict would be ill advised. I'm open to other suggestions for how to specify the type of the extra entries, but I can't think of any better suggestions. Specifying the type as a class declaration argument isn't a good choice. -Eric