News for hackers. Stuff that matters.
Re:PySnooper: Never use print for debugging again by strunz on Monday April 22, 2019 @01:51PM (#19721008)
I love using PDB, but even still this has a different use case. Say you have a bug in a function and it depends on timing or it's a race condition, or it has a lot of statements. Being able to see the state throughout the function in your output may be able to catch things or speed up debugging.
Re:PySnooper: Never use print for debugging again by BenFrantzDale on Monday April 22, 2019 @04:52PM (#19722863)
Agreed. My go-to for debugging is `import epdb;epdb.st()` which is a quick and dirty breakpoint. There may be more elegant solutions but that has served me very well.
Re:PySnooper: Never use print for debugging again by askvictor on Monday April 22, 2019 @06:00PM (#19723438)
True, though pysnooper (and print statements for that matter) will change the execution speed, so won't necessarily catch timing bugs (or introduce new ones).