February 2019
Intermediate to advanced
672 pages
16h 50m
English
The with statement in Python sometimes causes confusion for novice and experienced Python programmers alike. This chapter explains in depth the idea behind the with statement as a context manager and its usage in concurrent and parallel programming, specifically regarding the use of locks while synchronizing threads. This chapter also provides specific examples of how the with statement is most commonly used.
The following topics will be covered in this chapter: