Next / Previous / Contents / TCC Help System / NM Tech homepage

15. Exceptions

Python's exception mechanism allows you to signal errors in a flexible, general way, and also to handle errors. See the try and raise statements above.

A variety of exceptions are built into Python, and they are arranged in a hierarchy so that you can handle either specific individual exceptions or larger groupings of them.

Here is the current exception hierarchy. Indentation shows the inheritance: for example, all exceptions inherit from Exception; ArithmeticError inherits from StandardError; and so on.