ipdb icon indicating copy to clipboard operation
ipdb copied to clipboard

List comprehension problem

Open zwedwin opened this issue 3 years ago • 7 comments

While using IPython import embed; embed() in an ipdb session list comprehensions seem to have a broken scope, take the snippet as an example. Confirmed this is not an IPython issue. image (41)

zwedwin avatar Nov 09 '22 21:11 zwedwin

Normal IPython output, outside of an ipdb session image

zwedwin avatar Nov 09 '22 21:11 zwedwin

What do you mean by an ipdb session ?

Can you describe how you start it ?

gotcha avatar Dec 13 '22 19:12 gotcha

Ill be a bit pedantic for clarity: import ipdb; ipdb.set_trace() somewhere in a python file as a breakpoint. Run the file, now were in a ipdb "session" (at least thats what I mean by session)

Run this from the cli from IPython import embed embed()

Then you should be able to reproduce the error in the resulting "embeded" ipython session.

zwedwin avatar Dec 19 '22 18:12 zwedwin

@zwedwin Thanks for the clarification. It helps to reproduce the issue.

And sorry to ask for pedantic explanations: as the README mentions, there are various ways to use ipdb.

gotcha avatar Dec 20 '22 23:12 gotcha

No worries! thanks for looking into it

zwedwin avatar Jan 05 '23 18:01 zwedwin