[3.13] gh-123344: Add missing ast optimizations for PEP 696 (GH-123377) (#123427)

(cherry picked from commit be083cee34)

Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-08-28 16:02:34 +02:00 committed by GitHub
parent fbc975223b
commit 19a1f18740
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 99 additions and 9 deletions

View file

@ -1086,10 +1086,13 @@ astfold_type_param(type_param_ty node_, PyArena *ctx_, _PyASTOptimizeState *stat
switch (node_->kind) {
case TypeVar_kind:
CALL_OPT(astfold_expr, expr_ty, node_->v.TypeVar.bound);
CALL_OPT(astfold_expr, expr_ty, node_->v.TypeVar.default_value);
break;
case ParamSpec_kind:
CALL_OPT(astfold_expr, expr_ty, node_->v.ParamSpec.default_value);
break;
case TypeVarTuple_kind:
CALL_OPT(astfold_expr, expr_ty, node_->v.TypeVarTuple.default_value);
break;
}
return 1;