gotcha / ipdb

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

No access to exhaustive globals() #275

Open joos2010kj opened 1 year ago

joos2010kj commented 1 year ago

Pretend we have a file as follows:

import numpy as np

def main():
    import ipdb; ipdb.set_trace()

if __name__ == "__main__":
    main()

Here, when you type in "np.array([0])", it works without an issue. Now if you go to "interact," and if you repeat the same, you will get an error.


Why is this happening?

For some reason, interact does not offer exhaustive variables in globals(). This is quite frustrating as I commonly deal with such problem. Now, if you are wondering if the same problem persists in other pdbs, based on my experience, pdb and pdbpp do not have this problem.

It would be great if this issue can be resolved.