[issue40196] symtable.Symbol.is_local() can be True for global symbols
Wolfgang Stöcher
report at bugs.python.org
Sun Apr 5 09:30:26 EDT 2020
New submission from Wolfgang Stöcher <wolfgang at stoecher.com>:
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 stdout:
symbol 'e' in function scope: is_global() = True, is_local() = True
global scope: e = 1
----------
components: Library (Lib)
files: global_and_local.py
messages: 365820
nosy: coproc
priority: normal
severity: normal
status: open
title: symtable.Symbol.is_local() can be True for global symbols
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49037/global_and_local.py
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40196>
_______________________________________
More information about the Python-bugs-list
mailing list