I’m not sure if it is worthwhile if we only add support to closed=True
. The sample of early adapters [1] [2], while small, of the experimental implementations, all seem to use __extra_keys__
already. This contradicts to what I assumed in Supporting TypedDict(extra=type)
.
I would prefer going with Option 4 if the issue of using type expression there is no longer the main concern. With Option 1 it seems that its issues root in the lack of elegance of making an otherwise regular key special. In contrast, issues with Option 4 seems to be evolving in a positive direction (glad to see all the progress on the typing spec!)
Regarding the still present issue with forward references, I believe that the concern is that it adds burden on the type checkers, right? String literals need to be special cased for extra_value
, and this behavior (PEP 563) will not be dropped until the EOL of Python 3.13 in 2029-10.
I’m open to exploring Option 2, but at the moment Option 4 seems more practical.