The Exception Hierarchy
Learn about the exception hierarchy in Python.
We'll cover the following...
We’ve already seen several of the most common built-in exceptions, and we’ll probably encounter the rest over the course of our regular Python development.
As we noticed earlier, most exceptions are subclasses of the Exception
class.
But this is not true of all exceptions. The Exception
class actually extends a class called BaseException
. In fact, all exceptions must extend the BaseException
class or one of its subclasses.
Types of BaseException
There are two key built-in exception classes:
SystemExit