gotcha / ipdb

Integration of IPython pdb
BSD 3-Clause "New" or "Revised" License
1.85k stars 146 forks source link

List comprehension problem #256

Open zwedwin opened 1 year ago

zwedwin commented 1 year ago

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 commented 1 year ago

Normal IPython output, outside of an ipdb session image

gotcha commented 1 year ago

What do you mean by an ipdb session ?

Can you describe how you start it ?

zwedwin commented 1 year ago

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.

gotcha commented 1 year ago

@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.

zwedwin commented 1 year ago

No worries! thanks for looking into it