| | |
- __builtin__.object
-
- closing
class closing(__builtin__.object) |
| |
Context to automatically close something at the end of a block.
Code like this:
with closing(<module>.open(<arguments>)) as f:
<block>
is equivalent to this:
f = <module>.open(<arguments>)
try:
<block>
finally:
f.close() |
| |
Methods defined here:
- __enter__(self)
- __exit__(self, *exc_info)
- __init__(self, thing)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |