2 ms·
Most recently, Python 3.11 changed syntax to allow for variadic generics: https://peps.python.org/pep-0646/#grammar-changes https://peps.python.org/pep-0646/#g
by int_19h 4y ago
Most recently, Python 3.11 changed syntax to allow for variadic generics:
https://peps.python.org/pep-0646/#grammar-changes https://peps.python.org/pep-0646/#grammar-changes
The other case that I remember off the top of my head is Python 3.6 adding annotations for variables that aren't created via function definitions:
https://peps.python.org/pep-0526/ https://peps.python.org/pep-0526/
- davidatbu 4y agoI 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 ...