diff -r d61d6cb128a0 bz2.txt --- a/bz2.txt Fri May 07 19:39:43 2010 -0400 +++ b/bz2.txt Fri May 07 20:48:58 2010 -0400 @@ -21,7 +21,8 @@ * :class:`BZ2File` class implements a complete file interface, including :meth:`~BZ2File.readline`, :meth:`~BZ2File.readlines`, - :meth:`~BZ2File.writelines`, :meth:`~BZ2File.seek`, etc; + :meth:`~BZ2File.writelines`, :meth:`~BZ2File.seek`, etc; but not + the :ref:`context-managers` functions. * :class:`BZ2File` class implements emulated :meth:`~BZ2File.seek` support; @@ -38,6 +39,14 @@ * Thread safety uses individual locking mechanism. +.. note:: + The :class:`BZ2File` class does not implement the :ref:`context-managers` + protocol. Specifically it does not define the :meth:`__enter__` and + :meth:`__exit__` methods required by the :keyword:`with` statement. + This minor omission has been corrected in Python 3 but was + considered not sufficiently troublesome to warrant an entire + Python 2 platform release. + (De)compression of files ------------------------ diff -r b1cec42fb421 3.0.txt --- a/3.0.txt Fri May 07 20:35:00 2010 -0400 +++ b/3.0.txt Fri May 07 20:51:30 2010 -0400 @@ -780,6 +780,10 @@ * :meth:`__nonzero__` is now :meth:`__bool__`. +* :meth:`__enter__` and :meth:`__exit__` context manager methods have + been added to the :class:`bz2.BZ2File` file object to support the + :keyword:`with` statement. + Builtins --------