3 ms·
I actually meant to refer to PEP 526 when I said "python 3.5", thanks for that correction! Also thanks about pointing out the syntax change for variadic generi
by davidatbu 4y ago
I actually meant to refer to PEP 526 when I said "python 3.5", thanks for that correction!
Also thanks about pointing out the syntax change for variadic generics! I still think my overall point about pace of "syntactic innovation" in static typing remaining slow stands, though. Just comparing equivalent typescript and python constructs:
This in TS:
{ member?: string, other_member: string }
is currently in python:
from typing import TypedDict
class SmallerObj(TypedDict, total=False):
member: str
class Obj(SmallerObj):
other_member: str
Python 3.11 will shorten the above to:
from typing import TypedDict, NotRequired
class Obj(TypedDict):
member: NotRequired[str]
other_member: str
But still ...