diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-29 10:49:46 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-29 10:49:46 (GMT) |
commit | c3ed2e7f8326d703ed971220a7eb76317341efbf (patch) | |
tree | d7bfa945b55a990f608aa5ccb9b8a3caaac2a02d /Doc/library/gzip.rst | |
parent | 4c2e4fa242d2567e6f0bb5d112cc4e3c5d085b68 (diff) | |
download | cpython-c3ed2e7f8326d703ed971220a7eb76317341efbf.zip cpython-c3ed2e7f8326d703ed971220a7eb76317341efbf.tar.gz cpython-c3ed2e7f8326d703ed971220a7eb76317341efbf.tar.bz2 |
Issue #9962: GzipFile now has the peek() method.
Diffstat (limited to 'Doc/library/gzip.rst')
-rw-r--r-- | Doc/library/gzip.rst | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst index dc04ba0..0ae23d2 100644 --- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -25,10 +25,10 @@ The module defines the following items: .. class:: GzipFile(filename=None, mode=None, compresslevel=9, fileobj=None, mtime=None) - Constructor for the :class:`GzipFile` class, which simulates most of the methods - of a :term:`file object`, with the exception of the :meth:`readinto` and - :meth:`truncate` methods. At least one of *fileobj* and *filename* must be - given a non-trivial value. + Constructor for the :class:`GzipFile` class, which simulates most of the + methods of a :term:`file object`, with the exception of the :meth:`truncate` + method. At least one of *fileobj* and *filename* must be given a non-trivial + value. The new class instance is based on *fileobj*, which can be a regular file, a :class:`StringIO` object, or any other object which simulates a file. It @@ -66,8 +66,9 @@ The module defines the following items: writing as *fileobj*, and retrieve the resulting memory buffer using the :class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method. - :class:`GzipFile` supports the whole :class:`io.BufferedIOBase` interface, - including iteration and the :keyword:`with` statement. + :class:`GzipFile` supports the :class:`io.BufferedIOBase` interface, + including iteration and the :keyword:`with` statement. Only the + :meth:`truncate` method isn't implemented. .. versionchanged:: 3.1 Support for the :keyword:`with` statement was added. @@ -78,6 +79,9 @@ The module defines the following items: .. versionchanged:: 3.2 Support for unseekable files was added. + .. versionchanged:: 3.2 + The :meth:`peek` method was implemented. + .. function:: open(filename, mode='rb', compresslevel=9) |