News for hackers. Stuff that matters.
Re:The unreasonable effectiveness of print debugging by fake-name on Saturday April 24, 2021 @10:10PM (#26929794)
For complex problems, `import pdb; pdb.set_trace()` instead of a print statement can be super handy. It basically launches the debugger from the context of wherever you stuck the line.

For large unwieldy data-structures, you can go ipython: `import IPython; IPython.embed()` launches the ipython REPL from the calling line's context.

I use the latter a fair bit when spelunking around in other people's code. `pdb.set_trace()` lets you continue execution more easily.

There are no comments on this comment yet.