Trees | Indices | Help |
|
---|
|
Utilities for with-statement contexts. See PEP 343.
|
|||
GeneratorContextManager Helper for @contextmanager decorator. |
|||
closing Context to automatically close something at the end of a block. |
|
|||
|
|||
|
Imports: sys
|
@contextmanager decorator. Typical usage: @contextmanager def some_generator(<arguments>): <setup> try: yield <value> finally: <cleanup> This makes this: with some_generator(<arguments>) as <variable>: <body> equivalent to this: <setup> try: <variable> = <value> <body> finally: <cleanup> |
Support multiple context managers in a single with-statement. Code like this: with nested(A, B, C) as (X, Y, Z): <body> is equivalent to this: with A as X: with B as Y: with C as Z: <body>
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0 on Tue Jan 29 22:40:33 2008 | http://epydoc.sourceforge.net |