mirror of
https://github.com/python/cpython.git
synced 2025-09-01 06:28:36 +00:00
in dict displays, evaluate the key before the value (closes #11205)
Patch partially by Steve Dougherty.
This commit is contained in:
parent
44e625860b
commit
ee85339cc6
6 changed files with 127 additions and 113 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue