4 ms·
About error messages: There are quite a few questions on Stack Overflow where understanding the error message followed by a tiny bit of debugging would have fou
by Pinus 5y ago
About error messages: There are quite a few questions on Stack Overflow where understanding the error message followed by a tiny bit of debugging would have found the problem. I always wonder whether such questions are the effect of people simply not understanding the error message. One would think that "'NoneType' object has no attribute 'foo'" would lead the asker to think "oh, my variable is None, now why did that happen, oh, bar() returns None if..." but they're stymied. Maybe the "NoneType" is confusing.
Similarly, there are questions where people claim to have been struggling (or watching YouTube videos!) for hours, while spending 30 seconds reading the manual for the function they are calling would have made it obvious that it does not do what they think it does.
I wonder whether the printing of tracebacks simple causes there to be too much text. I use some tools at work that spew out hundreds of lines when everything goes well, and thousands — most of them useless — when things go wrong. I always hate trying to hunt down errors in those, because I have not yet developed the skill to read them at a glance, so I need to look at all of it. I can read a Python traceback quickly, but a beginner probably can't.
- throwaway81523 5y agoI wish Python came with the ability to break to pdb (the debugger) in case of an unhandled exception. There are various Python IDE's that can do it. I think this came up here before and someone had a useful suggestion that I've forgotten, but something really simple like (setq debug-on-error t) in emacs lisp would be great.