Wolfgang Stöcher added the comment:
In symtable.Function.get_locals() symbols with scopes in (LOCAL, CELL) are
selected. Also
>>> code = """\
... def foo():
...x = 42
...def bar():
... return x
... """
>>> import symta
Wolfgang Stöcher added the comment:
see https://stackoverflow.com/a/61040435/1725562 for a proposed fix
--
type: -> behavior
___
Python tracker
<https://bugs.python.org/issu
New submission from Wolfgang Stöcher :
Consider this function:
def f():
global e
e = 1
When inspecting symbols with symtable, symbol 'e' will be global and local,
whereas is_local() should return False. See the attached file for reproducing.
It will output to stdou