News for hackers. Stuff that matters.
Re:Guide to Python Debugging by drpancake on Tuesday June 02, 2020 @03:22AM (#23388544)
I've been a Python developer for more than ten years. Approximately 98% of the time I need to debug something I use print() statements and this:

  import IPython; IPython.embed()
Re:Guide to Python Debugging by quickthrower2 on Tuesday June 02, 2020 @04:38AM (#23388980)
I've been a Python developer for less than 10 hours. Approximately 98% of the time debugged something was in Visual Studio. Quite a nice experience. I was lucky to have the project already set up for me.
Re:Guide to Python Debugging by justmyname on Tuesday June 02, 2020 @03:37AM (#23388628)
Oh, having full ipython during debug investigations is much better than using pure pdb.set_trace(). Thank you.
Re:Guide to Python Debugging by drpancake on Tuesday June 02, 2020 @05:20AM (#23389215)
You might find this useful: https://github.com/gotcha/ipdb
Re:Guide to Python Debugging by musingsole on Tuesday June 02, 2020 @12:43PM (#23393028)
This has been my go-to debug method for years now. Find a critical section of code, drop the embed call there (with maybe a print statement or two leading up to it for context).

For stepping through code, I agree with your other comments that it is often too much for debugging. To recreate it when really necessary, I might sprinkle a handful of embed calls

Re:Guide to Python Debugging by mbar84 on Tuesday June 02, 2020 @05:51AM (#23389373)
Are you aware of this:

  import pudb; pudb.set_trace()
Re:Guide to Python Debugging by drpancake on Tuesday June 02, 2020 @06:37AM (#23389561)
Yes. My point is that I find stepping through code (e.g. using pdb) to be overkill in most cases.
Re:Guide to Python Debugging by jordigh on Tuesday June 02, 2020 @10:06AM (#23391121)
Or

    import pudb; pu.db
for the impatient typist.
Re:Guide to Python Debugging by trymas on Tuesday June 02, 2020 @04:56AM (#23389083)
Can you step through the code when embedding ipython in your code? Does this approach have advantages versus `ipdb` or `pdb++` ?
Re:Guide to Python Debugging by drpancake on Tuesday June 02, 2020 @05:08AM (#23389145)
No, but I rarely find it helpful to step through code. That's the other 2%.
Re:Guide to Python Debugging by jsmeaton on Tuesday June 02, 2020 @06:14AM (#23389459)
import ipdb; ipdb.set_trace()

IPython pdb session.

Re:Guide to Python Debugging by drpancake on Tuesday June 02, 2020 @06:33AM (#23389539)
Yes I'm aware of this.