I no longer support this. T|None is a fine way to write optional types, and doesn't require new syntax.
We should also consider that in e.g. TypeScript, x? means something quite different than T|None; there, x? refers to allowing the absence of a parameter or field, not its type (more like NotRequired in your PEP 655). This could be confusing for users who use both languages.
On Tue, Mar 29, 2022 at 10:26 PM David Foster firstname.lastname@example.org wrote:
The typing-related PEP 645 - which introduces the syntax `T?` to mean `Optional[T]` - only has a single substantial related commit in the PEPs repo - the commit introducing the PEP (in Nov 2020) - and no discussions thread that I can find (on typing-sig or elsewhere).
I'm personally quite interested in the potential capability to quickly signify `Optional[T]` since it is something I do a lot.
What is the status of this PEP? Deferred for now? Withdrawn in favor of `T|None` syntax?† Something else?
-- David Foster | Seattle, WA, USA Contributor to TypedDict, mypy, and Python's typing system
† Through the grapevine I've been inferring that folks have been gravitating toward the slightly-shorter `T|None` syntax to spell `Optional[T]` in the meantime, and I even mention that spelling in my own PEP 655 (Required)