Exception Chaining and Tracebacks
Tracing an unhandled exception can get more difficult if one exception is handled, only for another to be invoked in the very try statement that's doing the handling. The biggest worry from the debugger's perspective is that the original exception, having been dealt with, might be inaccessible. However, tracebacks provide a way of establishing from one exception if it was raised in the context of handling a different exception this is called exception chaining. If one exception is being...
A Final Note on Pythonic Exception Handling
Some languages try to make exception handling a last resort the syntax can often be cumbersome and the functionality basic and the performance of the language interpreter might suffer during its equivalent of try statements. But as you have seen, Python actively encourages error handling, through simple syntax with a fully developed flow control based on exception handling. Also, in most Python distributions, exception handling is no slower than simple if else flow control. When a language...