diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-09-02 15:49:30 -0400 |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-09-02 15:49:30 -0400 |
commit | 2051b84f44a295e6668054e56db637a07e962698 (patch) | |
tree | 6b29c642aab218c99980af6605c1352ce81e24b2 /Python/ast.c | |
parent | 44a25faf7c7eec735caeee2b0adcbe0446c92760 (diff) | |
parent | b3d531348c40b195e6bb742d956ea749b3f7a969 (diff) | |
download | cpython-git-2051b84f44a295e6668054e56db637a07e962698.tar.gz |
Merge 3.5 heads (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 b572088a46..b2f09b9c84 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) \ |