This PEP [1] introduces syntax to mark individual keys of a TypedDict as either required or potentially-missing. Previously the only way to have a TypedDict with mixed required and non-required keys was to define two TypedDicts - one with total=True and one with total=False - and have one of those TypedDicts inherit from the other. This PEP introduces special forms Required[] and NotRequired[] to the "typing" module that can be used to directly mark individual items of a TypedDict as required or not-required. We have implementations for mypy, pyright, and pyanalyze.
Consensus on the PEP has been reached in typing-sig.
My understanding of the PEP process as described in PEP 1 [2] is that content review should be requested of core developers here in python-dev. So consider this my official request for comments! ^_^
I believe that after review & feedback from python-dev the next step would be to submit this PEP to the Steering Council. However it's not clear to me from [2] where I should actually do that when the time comes. I think the names `Required` and `NotRequired` are too generic for something which can only be used in one context (`TypedDict`s), and it is not immediately obvious when reading code without context what the difference between `NotRequired` and `Optional` might be. Could they be
On 30/01/2022 05:15, David Foster wrote: put into a pseudo-module like `typing.io`, e.g. `TypedDict.Required`?