summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-05-28 19:30:26 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-05-28 19:30:26 (GMT)
commitee85339cc69af6b29a37b85a5695fb9c12f0f0a3 (patch)
tree01f7a995722d516c61b70e1578d43628ab1f2a9f /Python/compile.c
parent44e625860bf4c24a811eb81c7953a71671c89608 (diff)
downloadcpython-ee85339cc69af6b29a37b85a5695fb9c12f0f0a3.zip
cpython-ee85339cc69af6b29a37b85a5695fb9c12f0f0a3.tar.gz
cpython-ee85339cc69af6b29a37b85a5695fb9c12f0f0a3.tar.bz2
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 7820f39..5905910 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 {