September 2026
1051 pages
35h 4m
English
Python also contains a set of built-in exception types. These exceptions are raised by functions of the standard library or by the interpreter itself. They are built-in, which means they can be used at any time in the source code. Table A.4 lists the built-in exception types and common circumstances in which they occur. The inheritance hierarchy is indicated by the indentation depth of the type name.
|
Exception Type |
Appearance |
|---|---|
|
BaseException |
Base class of all built-in exception types (see Chapter 20, Section 20.1.1) |
|
SystemExit |
When exiting the program via sys.exit. This exception doesn’t cause a traceback. |
|
KeyboardInterrupt |
When exiting the program via a key combination (usually Ctrl+C). |
Read now
Unlock full access