New submission from Wolfgang Stöcher <[email protected]>:
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 <[email protected]>
<https://bugs.python.org/issue40196>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com