Trees Indices Help
Python Standard Library
Module contextlib :: Class closing
[]

type closing

object --+
 |
 closing

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()
Instance Methods [hide private]
__init__(self, thing)
__enter__(self)
__exit__(self, *exc_info)
Method Details [hide private]

__init__(self, thing)
(Constructor)

Overrides: object.__init__
(inherited documentation)

Trees Indices Help
Python Standard Library

AltStyle によって変換されたページ (->オリジナル) /