In Python, with
statements can be nested. A usual use case is the connection to a database and opening a cursor:
|
|
Today I learned that with statements can have more than one such statement. The following is possible:
|
|
This also works with nested attributes. Back to the database example:
|
|
One can discuss about beauty of the intendation here, but it this works out.