Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
Closed
Description
Bug report
Bug description:
The following statement is invalid:
typeX[T_default=int,T]= (T_default,U)# SyntaxError: non-default type parameter 'T' follows default type parameter
However, writing it as aTypeAliasType is possible. The following should likely raise an error as well to mimic this behavior:
from typing import TypeAliasType, TypeVarT = TypeVar('T')T_default = TypeVar("T_default", default=int)TypeAliasType("TupleT_default_reversed", tuple[T_default, T], type_params=(T_default, T))print("OK")CPython versions tested on:
3.13
Operating systems tested on:
Linux