Feb. 20, 2021
4:21 p.m.
On 2/20/21 8:15 AM, David Foster wrote:
1. How about we support NotRequired[...] in general?
2. How do folks feel about *also* supporting Required[...] for when a total=False TypedDict really is more appropriate?
As a quick followup comment: If we were to support both NotRequired[...] and Required[...] it would translate well to the proposed eventual shorthand + and - syntax for these wrappers: ``` class MyThing(TypedDict, total=False): req1: +int # + means Required[...] opt1: str req2: +float class MyThing(TypedDict): req1: int opt1: -str # - means NotRequired[...] req2: float ``` -- David Foster | Seattle, WA, USA Contributor to TypedDict support for mypy