Hacker News new | ask | show | jobs
by aurelianito 4332 days ago
For one, I think repr is more fit.

And if repr (or str) has a bug, now you are chasing two issues! Besides, repr (or str) may take a lot of processing time and it is not unusual to log an exception stack trace but keep running.

At last, if you are going to debug, a lot of times is better to use a debugger instead of putting print (or log) statements all around. I prefer pydev for this. You can even attach to a python process running as a different user or even on a different computer.

I documented how to do it in a post on my blog (sorry, in Spanish). http://aurelianito.blogspot.com.ar/2013/05/debugueando-en-ro...

1 comments

If you prefer the console, pudb is an absolutely fantastic curses debugger. I love it.