Matthew Fennell
@matthew@fennell.dev
pdb while writing some stuff in #Python, and it's really nice to interact with!I like that:
breakpoint() function, making conditional breakpoints very natural:if [condition]:
breakpoint()
In other languages, I slightly dread starting a debug session because I have to remember the flag to pass extra args, add all the breakpoints on startup etc. This leads to long sessions because I don't want to lose the investment I've put into my breakpoints.
But in Python, I have much shorter debug sessions and I can get right to a point of invocation really quickly, verify something, and close the debugger straight away.
I use the repl much more because I can end up in a repl right with the context and variables that I need.
Defining more breakpoints within the repl is really nice to unpack nested datastructures in the same way it would be done in the code:
>>> for key, some_list in some_dict.items():I end up writing things in the repl first, but within the context that the code would be written in reality.
... for value in some_list:
... breakpoint()
It's really thoughtfully designed - thank you to the people who made it so!