
Jan. 5, 2021
9:27 p.m.
I agree with Guido that none of these proposals sounds quite right. I like the `Required` annotation proposal. If this becomes a common use case, we could make it terser in the future by leveraging one of the existing unary operators (`__pos__`, `__neg__` and `__invert__`). This could be done without modifying the grammar. For example, by defining an `__invert__` operator on `type`, the syntax would look like the following: ```python class MyThing(TypedDict, total=False): req1: int opt1: ~str req2: float ``` I recommend first releasing support for `Required` before attempting to make it more terse. This is the same approach that was used for `Union`, which can now be specified using the `__or__` operator.