[New-bugs-announce] [issue42355] symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all

Batuhan Taskaya report at bugs.python.org
Sat Nov 14 05:27:36 EST 2020


New submission from Batuhan Taskaya <isidentical at gmail.com>:

>>> table = symtable.symtable("A = 1", "<string>", "exec")
>>> table.lookup("A")
<symbol 'A'>
>>> table.lookup("A").get_namespace()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/symtable.py", line 312, in get_namespace
    raise ValueError("name is bound to multiple namespaces")
ValueError: name is bound to multiple namespaces
>>> table.lookup("A").get_namespaces()
()

----------
assignee: BTaskaya
components: Library (Lib)
messages: 380969
nosy: BTaskaya, benjamin.peterson
priority: normal
severity: normal
status: open
title: symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42355>
_______________________________________


More information about the New-bugs-announce mailing list