Message365853
In symtable.Function.get_locals() symbols with scopes in (LOCAL, CELL) are selected. Also
>>> code = """\
... def foo():
... x = 42
... def bar():
... return x
... """
>>> import symtable
>>> top = symtable.symtable(code, "?", "exec")
>>> top.get_children()[0].lookup('x')._Symbol__scope == symtable.CELL
True
So I guess this would be the correct fix then:
def is_local(self):
return self.__scope in (LOCAL, CELL) |
|
Date |
User |
Action |
Args |
2020-04-06 13:28:36 | coproc | set | recipients:
+ coproc, pablogsal |
2020-04-06 13:28:36 | coproc | set | messageid: <1586179716.12.0.202649731569.issue40196@roundup.psfhosted.org> |
2020-04-06 13:28:36 | coproc | link | issue40196 messages |
2020-04-06 13:28:36 | coproc | create | |
|