May 2019
Beginner
528 pages
29h 51m
English
In the previous chapter, we introduced exception handling. Every exception is an object of a class in Python’s exception class hierarchy11 or an object of a class that inherits from one of those classes. Exception classes inherit directly or indirectly from base class BaseException and are defined in module exceptions.
Python defines four primary BaseException subclasses—SystemExit, KeyboardInterrupt, GeneratorExit and Exception:
SystemExit terminates program execution (or terminates an interactive session) and when uncaught does not produce a traceback like other exception types.
KeyboardInterrupt exceptions occur when the user types ...
Read now
Unlock full access