June 2019
Beginner to intermediate
770 pages
19h 24m
English
Exceptions that arise in a context manager's block will be passed to the __exit__() method of the context manager. The standard bits of an exception – the class, arguments, and the traceback stack – will all be provided as argument values.
The __exit__() method can do one of the following two things with the exception information:
An exception might also be used to alter what the context manager does on exit. We might, for example, have to carry out special processing for certain types ...
Read now
Unlock full access