jwjacobson / jazztunes

a jazz repertoire management app
https://jazztunes.org
GNU General Public License v3.0
4 stars 1 forks source link

Quick debugger / pdb resource (and how I use it) #51

Closed bbelderbos closed 11 months ago

bbelderbos commented 11 months ago

Here is a quick video: https://youtube.com/watch?v=OWGyfBBwpSM

I use it for way more than just fixing bugs:

pdb is like the Swiss Army knife of programming tools for me. 🔥

ryaustin commented 11 months ago

I couldn't agree more @bbelderbos. I write code in pdb as well then copy whats working into my python file.

I do prefer ipdb because it fits my style with tab completion which allows me to discover the API on the fly or just in time plus some nice rich colors :).

bbelderbos commented 11 months ago

Nice, and the commands you'll use can be counted on one hand, it's more getting into the habit of putting breakpoint() and writing code in the debugger, no magic there, just habit forming. I need to check ipdb again Ryan, tab completion seems useful! Thanks.

jwjacobson commented 11 months ago

Ryan it looks like my pytest is using vanilla pdb for now because I don't have tab completion and man am I missing it! Just trying to figure out the various 'paths' through the objects. I think I'll look into upgrading...

bbelderbos commented 11 months ago

And I saw @ryaustin already "sneaked" it into manage.py the other day ;)

$ git blame manage.py
...
7f1a3e4a (ry_austin   2023-11-30 12:31:09 -0500  9)     os.environ.setdefault("PYTHONBREAKPOINT", "ipdb.set_trace")

So Jeff only has to pip install ipdb now and good to go right?

ryaustin commented 11 months ago

Yup!