@@ -645,13 +645,13 @@ type_param_seq[asdl_type_param_seq*]: a[asdl_type_param_seq*]=','.type_param+ ['
645
645
646
646
type_param[type_param_ty] (memo):
647
647
| a=NAME b=[type_param_bound] c=[type_param_default] { _PyAST_TypeVar(a->v.Name.id, b, c, EXTRA) }
648
- | '*' a=NAME [type_param_default] colon=':' e=expression {
648
+ | '*' a=NAME colon=':' e=expression {
649
649
RAISE_SYNTAX_ERROR_STARTING_FROM(colon, e->kind == Tuple_kind
650
650
? "cannot use constraints with TypeVarTuple"
651
651
: "cannot use bound with TypeVarTuple")
652
652
}
653
- | '*' a=NAME b=[type_param_default ] { _PyAST_TypeVarTuple(a->v.Name.id, b, EXTRA) }
654
- | '**' a=NAME [type_param_default] colon=':' e=expression {
653
+ | '*' a=NAME b=[type_param_starred_default ] { _PyAST_TypeVarTuple(a->v.Name.id, b, EXTRA) }
654
+ | '**' a=NAME colon=':' e=expression {
655
655
RAISE_SYNTAX_ERROR_STARTING_FROM(colon, e->kind == Tuple_kind
656
656
? "cannot use constraints with ParamSpec"
657
657
: "cannot use bound with ParamSpec")
@@ -661,6 +661,8 @@ type_param[type_param_ty] (memo):
661
661
type_param_bound[expr_ty]: ':' e=expression { e }
662
662
type_param_default[expr_ty]: '=' e=expression {
663
663
CHECK_VERSION(expr_ty, 13, "Type parameter defaults are", e) }
664
+ type_param_starred_default[expr_ty]: '=' e=starred_expression {
665
+ CHECK_VERSION(expr_ty, 13, "Type parameter defaults are", e) }
664
666
665
667
# EXPRESSIONS
666
668
# -----------
0 commit comments