O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Built-in Exceptions

Built-in exceptions are contained in the exceptions module, which is always loaded prior to the execution of any program. Exceptions are defined as classes. The following exceptions serve as base classes for all the other exceptions:

Exception

The root class for all exceptions. All built-in exceptions are derived from this class. User-defined exceptions should use this as a base class.

StandardError

The base class for all built-in exceptions except for SystemExit and StopIteration.

ArithmeticError

The base class for arithmetic exceptions, including OverflowError, ZeroDivisionError, and FloatingPointError.

LookupError

The base class for indexing and key errors, including IndexError and KeyError.

EnvironmentError

The base class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required