X Tutup
The Wayback Machine - https://web.archive.org/web/20200905014603/https://github.com/bpython/bpython/issues/769
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Names not defined in list comprehension within function scope #769

Open
rpdelaney opened this issue Mar 11, 2019 · 0 comments
Open

Names not defined in list comprehension within function scope #769

rpdelaney opened this issue Mar 11, 2019 · 0 comments

Comments

@rpdelaney
Copy link

@rpdelaney rpdelaney commented Mar 11, 2019

bpython seems to be affected by the same issues as IPython that are described here: inducer/pudb#103

For example, when debugging via pudb and bpython:

>>> tags.keys()
dict_keys(['foo', 'bar'])
>>> [key for key in tags.keys()]
['foo', 'bar']
>>> [name in tags.keys() for name in container_names]
Traceback (most recent call last):
  File "<pudb command line>", line 1, in <module>
  File "<pudb command line>", line 1, in <listcomp>
NameError: name 'tags' is not defined

A very puzzling error.

Note that globals().update(locals()) is a temporary fix but it must be run manually every time I want access to a new local variable in a list comprehension, as described in this comment to the pudb issue linked above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.
X Tutup