[issue40196] symtable.Symbol.is_local() can be True for global symbols

2020-04-06 Thread Wolfgang Stöcher
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

[issue40196] symtable.Symbol.is_local() can be True for global symbols

2020-04-05 Thread Wolfgang Stöcher
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

[issue40196] symtable.Symbol.is_local() can be True for global symbols

2020-04-05 Thread Wolfgang Stöcher
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