What I don't understand about Python is why it's not printing the str() of the variables in the corresponding lines of the traceback. About 95% of all debugging starts with adding prints or logging messages before the lines mentioned in the traceback. Or am I doing something wrong here (since 5 years...)?
To be honest. As cool as this feature is in the 1% of cases where I wanted it, so annoying is it in 99% of all other cases. Tracebacks on Python 3 became a lot more complex because very often exceptions are intentionally swallowed to be reraised differently and they just mess up the traceback now.<p>For instance any custom collection that acts as a decorator will now generate very large tracebacks.<p>I would have much preferred if the reraising with old traceback would have been a feature you can enable per site where you raise.
I don't understand Python exceptions that well. But it's great to have the pattern of maintaining the stack trace when re-raising an exception. Thanks OP!<p>(In case anyone missed it)<p><pre><code> except foo.FooException as e:
raise BarException, BarException(e), sys.exc_info()[2]</code></pre>
Had the pleasure of working with the author (Ionel) a few years back on some Django projects. Always love reading his Python posts. Really inspiring developer.
Why is the current title ("An underrated feature in Python 3") neither the original source title ("The most underrated feature in Python 3") or a title more descriptive of the content (e.g., "Exception chaining in Python 3").<p>If we're going to get title changes, can we at least get <i>useful</i> title changes?