[Python-checkins] r70281 - in python/trunk/Doc/library: bz2.rst gzip.rst
benjamin.peterson
python-checkins at python.org
Mon Mar 9 21:38:57 CET 2009
Author: benjamin.peterson
Date: Mon Mar 9 21:38:56 2009
New Revision: 70281
Log:
gzip and bz2 are context managers
Modified:
python/trunk/Doc/library/bz2.rst
python/trunk/Doc/library/gzip.rst
Modified: python/trunk/Doc/library/bz2.rst
==============================================================================
--- python/trunk/Doc/library/bz2.rst (original)
+++ python/trunk/Doc/library/bz2.rst Mon Mar 9 21:38:56 2009
@@ -60,6 +60,11 @@
reading. Instances support iteration in the same way as normal :class:`file`
instances.
+ :class:`BZ2File` supports the :keyword:`with` statement.
+
+ .. versionchanged:: 2.7
+ Support for the :keyword:`with` statement was added.
+
.. method:: close()
Modified: python/trunk/Doc/library/gzip.rst
==============================================================================
--- python/trunk/Doc/library/gzip.rst (original)
+++ python/trunk/Doc/library/gzip.rst Mon Mar 9 21:38:56 2009
@@ -67,6 +67,11 @@
writing as *fileobj*, and retrieve the resulting memory buffer using the
:class:`StringIO` object's :meth:`getvalue` method.
+ :class:`GzipFile` supports the :keyword:`with` statement.
+
+ .. versionchanged:: 2.7
+ Support for the :keyword:`with` statement was added.
+
.. function:: open(filename[, mode[, compresslevel]])
More information about the Python-checkins
mailing list