diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-05-28 14:30:26 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-05-28 14:30:26 -0500 |
commit | ffe5c8f2c45e238c70ac87fecf23aeef676a65f6 (patch) | |
tree | 7721054b099c8d9254c11a2ea4ce1c0c26e03f06 /Python/compile.c | |
parent | 3786c5715f2bd866feafaa20f101f5b8a175138d (diff) | |
download | cpython-ffe5c8f2c45e238c70ac87fecf23aeef676a65f6.tar.gz |
in dict displays, evaluate the key before the value (closes #11205)
Patch partially by Steve Dougherty.
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c index 7820f39f87..5905910574 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -3138,8 +3138,8 @@ compiler_dict(struct compiler *c, expr_ty e) containers++; } else { - VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Dict.values, i)); VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Dict.keys, i)); + VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Dict.values, i)); elements++; } } @@ -3287,8 +3287,8 @@ compiler_call_helper(struct compiler *c, } else if (nsubkwargs) { /* A keyword argument and we already have a dict. */ - VISIT(c, expr, kw->value); ADDOP_O(c, LOAD_CONST, kw->arg, consts); + VISIT(c, expr, kw->value); nseen++; } else { |