mirror of
https://github.com/python/cpython.git
synced 2025-09-04 16:01:10 +00:00
bpo-36187: Remove NamedStore. (GH-12167)
NamedStore has been replaced with Store. The difference between NamedStore and Store is handled when precess the NamedExpr node one level upper.
This commit is contained in:
parent
adfffc7343
commit
d8b3a98c90
7 changed files with 103 additions and 143 deletions
|
@ -1452,6 +1452,10 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
|
|||
}
|
||||
switch (e->kind) {
|
||||
case NamedExpr_kind:
|
||||
if (st->st_cur->ste_comprehension) {
|
||||
if (!symtable_extend_namedexpr_scope(st, e->v.NamedExpr.target))
|
||||
VISIT_QUIT(st, 0);
|
||||
}
|
||||
VISIT(st, expr, e->v.NamedExpr.value);
|
||||
VISIT(st, expr, e->v.NamedExpr.target);
|
||||
break;
|
||||
|
@ -1555,11 +1559,6 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
|
|||
VISIT(st, expr, e->v.Starred.value);
|
||||
break;
|
||||
case Name_kind:
|
||||
/* Special-case: named expr */
|
||||
if (e->v.Name.ctx == NamedStore && st->st_cur->ste_comprehension) {
|
||||
if(!symtable_extend_namedexpr_scope(st, e))
|
||||
VISIT_QUIT(st, 0);
|
||||
}
|
||||
if (!symtable_add_def(st, e->v.Name.id,
|
||||
e->v.Name.ctx == Load ? USE : DEF_LOCAL))
|
||||
VISIT_QUIT(st, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue