CPython's types.GenericAlias Implementation in C
types.GenericAlias is a five-field C struct wrapping an origin and a tuple of args, with parameters computed lazily and cached under a critical section.
types.GenericAlias is a five-field C struct wrapping an origin and a tuple of args, with parameters computed lazily and cached under a critical section.
Python’s type variables – typing.TypeVar, typing.TypeVarTuple, typing.ParamSpec (plus typing.TypeAliasType) – used to live entirely in Lib/typing.py. In CPython 3.15 they are …