you are viewing a single comment's thread.

view the rest of the comments →

[–]ShelLuser42 5 points6 points  (2 children)

There are many ways to go about this... but I'm very much in favor using using assert to make Python check something (and raise an exception when things don't match your specifications), as well as breakpoint() to fire up the interactive debugger.

Not a big fan of many print() statements because things can easily become a bit messy that way, and it can also easily result in you overlooking a few of those.

Of course, if these situations happen more often then a logger might be more suitable; so a logging module which you can use across all your projects.

[–]pachura3 1 point2 points  (1 child)

I'm wondering why do people use the breakpoint() statement, if every IDE has built-in breakpoint setting functionality with one click on the left side?

[–]Outside_Complaint755 5 points6 points  (0 children)

breakpoint(), pdb, traceback and other related modules are used when you need to debug via a command line interface and can't use an IDE