Derived from the flake8-simplify linter.
Fix is sometimes available.
What it does#
Checks for the unnecessary nesting of multiple consecutive context managers.
Why is this bad?#
In Python 3, a single
with block can include multiple context
Combining multiple context managers into a single
will minimize the indentation depth of the code, making it more
The following context managers are exempt when used as standalone statements: