On 2/5/21 1:41 AM, Tuukka Mustonen wrote:
Thanks for pushing this forward!
I am not aware of the practices of writing a PEP, so maybe these other rejected ideas were left out on purpose:
- `|Missing` (as magic value)
Oversight on my part. Will add.
- `TypedDict(optional_as_nullable=...)` (though this only partially accomplishes the target)
Sure I can mention this too.
Could be maybe included under Rejected Ideas if not.
(Also, I would suggest to still re-consider using `NotRequired`, too. I personally don't think it's that bad. It's 100% obvious by meaning and harmonizes nicely with `Required`. If in the future something like `+` or `-` would replace the typed form, the wording will became even less important.)
I'm personally hoping that eventually we'll go toward the `+` or `-` forms if requireness/optionalness marking becomes a common feature. (Although that's a pretty big if, this early in the game.) -- David Foster | Seattle, WA, USA Contributor to TypedDict support for mypy