Message383659
This is another side effect of processing annotations (at the symbol table construction stage) (and I would assume there are a few more cases like this);
def foo():
outer_var = 1
def bar():
inner_var: outer_var = T
return bar
inner = foo()
print(inner.__closure__)
In theory, there shouldn't be any cells / references to the variables from outer scope, but since we process the entry for the annotation and record `outer_var` as a free var it is listed here. |
|
Date |
User |
Action |
Args |
2020-12-23 20:41:34 | BTaskaya | set | recipients:
+ BTaskaya, gvanrossum, lys.nikolaou |
2020-12-23 20:41:34 | BTaskaya | set | messageid: <1608756094.7.0.944899403116.issue42725@roundup.psfhosted.org> |
2020-12-23 20:41:34 | BTaskaya | link | issue42725 messages |
2020-12-23 20:41:34 | BTaskaya | create | |
|