diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-09-02 19:50:04 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-09-02 19:50:04 (GMT) |
commit | 1fa3652e59b5060d9c17671b24f8f92ec2a85326 (patch) | |
tree | 840fb19b8573d9950ee7462834077ad2b9eb7515 /Python/ast.c | |
parent | 177b8eb34fed9a299ad00cea8e8be45fd836ab91 (diff) | |
parent | 2051b84f44a295e6668054e56db637a07e962698 (diff) | |
download | cpython-1fa3652e59b5060d9c17671b24f8f92ec2a85326.zip cpython-1fa3652e59b5060d9c17671b24f8f92ec2a85326.tar.gz cpython-1fa3652e59b5060d9c17671b24f8f92ec2a85326.tar.bz2 |
Merge 3.5 (issue #24975)
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c index 8b356fe..c1ce0aa 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -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) \ |