4 ms·
In Python, I use the PDB/PDB++ debugger extensively. When you get a confusing or nonsensical error from deep inside an under-documented 3rd party library, somet
by nerdponx 5y ago
In Python, I use the PDB/PDB++ debugger extensively. When you get a confusing or nonsensical error from deep inside an under-documented 3rd party library, sometimes stepping through that code with a debugger is the only way to figure out what mistake you've made, or what under-documented assumptions the library makes. I also use it a lot for diagnosing test case failures, especially in property-based testing when I might have accidentally generated something I shouldn't have, or otherwise can't figure out why a test is failing.
The experience is even nicer in the Pycharm IDE, where I can set breakpoints with arbitrary conditional logic just by pointing and clicking. It's so easy it almost feels like cheating.
That said, Pycharm is a heavy beast. Psychologically it's not worth the overhead of opening it or even switching projects within it unless I'm working on something involved for an extended period of time. So figuring out how to do something like this in Neovim has been on my to-do list for a while.
I also use the built-in Python logging framework to help me identify where problems might be happening in the first place.
- auxym 5y agoFWIW, debugging python in VS Code is nice, also allows setting conditional breakpoints and watches. Nice middle of the road option between Pycharm and Neovim. Pretty much no setup, works out of the box after installing the python plugin.
- baal80spam 5y agoFully agree with debugging Python in VS Code. It's everything one can ask for.