mirror of
https://github.com/python/cpython.git
synced 2025-07-19 17:25:54 +00:00
Issue #24975: Fix AST compilation for PEP 448 syntax.
This commit is contained in:
parent
c332e0946a
commit
b3d531348c
3 changed files with 21 additions and 11 deletions
|
@ -199,8 +199,10 @@ validate_expr(expr_ty exp, expr_context_ty ctx)
|
|||
"Dict doesn't have the same number of keys as values");
|
||||
return 0;
|
||||
}
|
||||
return validate_exprs(exp->v.Dict.keys, Load, 0) &&
|
||||
validate_exprs(exp->v.Dict.values, Load, 0);
|
||||
/* null_ok=1 for keys expressions to allow dict unpacking to work in
|
||||
dict literals, i.e. ``{**{a:b}}`` */
|
||||
return validate_exprs(exp->v.Dict.keys, Load, /*null_ok=*/ 1) &&
|
||||
validate_exprs(exp->v.Dict.values, Load, /*null_ok=*/ 0);
|
||||
case Set_kind:
|
||||
return validate_exprs(exp->v.Set.elts, Load, 0);
|
||||
#define COMP(NAME) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue