Python's is actually a little nicer too, in 3.x - it has two types of chains, the 'root cause' one like Java, and a 'this is what I was handling when this exception happened' - to stop an error in your exception handling code hide the original error.
by reading this I just learned about the concept of chained exceptions, although I can't see why is so useful, the built-in traceback and sys module has always been good enough:
that's not nearly good enough, it's barely acceptable. i've been programming python for a decade and the fact you have to do this with exceptions was plainly dumb. as a programmer you should never have to worry about preserving tracebacks.
One issue is that almost every google search for documentation points to the 2.x version, sometimes even if you search for Python 3 meaning you have to manually find the dropdown and switch to a new version. I imagine this is cumbersome for many new developers.
Similarly, the author's definition of foo.py does not seem to actually define functions d, e, and f as referred to the traceback. That confused me for a bit.
17 comments
[ 3.0 ms ] story [ 49.6 ms ] threadThere are good times to use foo and bar, rather than more self-documenting style placeholder names, but this was not one of them for me.