This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author coproc
Recipients coproc, pablogsal
Date 2020-04-06.13:28:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586179716.12.0.202649731569.issue40196@roundup.psfhosted.org>
In-reply-to
Content
In symtable.Function.get_locals() symbols with scopes in (LOCAL, CELL) are selected. Also

>>> code = """\
... def foo():
...    x = 42
...    def bar():
...       return x
... """
>>> import symtable
>>> top = symtable.symtable(code, "?", "exec")
>>> top.get_children()[0].lookup('x')._Symbol__scope == symtable.CELL
True

So I guess this would be the correct fix then:

def is_local(self):
    return self.__scope in (LOCAL, CELL)
History
Date User Action Args
2020-04-06 13:28:36coprocsetrecipients: + coproc, pablogsal
2020-04-06 13:28:36coprocsetmessageid: <1586179716.12.0.202649731569.issue40196@roundup.psfhosted.org>
2020-04-06 13:28:36coproclinkissue40196 messages
2020-04-06 13:28:36coproccreate