summaryrefslogtreecommitdiffstats
path: root/Doc/library/gzip.rst
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-10-04 21:55:14 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-10-04 21:55:14 (GMT)
commit7b998e9f522e088675005eadc4bf934f3d212dc6 (patch)
treed0247ce95293b26887762fcddfe0f151625cbe11 /Doc/library/gzip.rst
parent977c707b425ee753d54f3e9010f07ec77ef61274 (diff)
downloadcpython-7b998e9f522e088675005eadc4bf934f3d212dc6.zip
cpython-7b998e9f522e088675005eadc4bf934f3d212dc6.tar.gz
cpython-7b998e9f522e088675005eadc4bf934f3d212dc6.tar.bz2
GzipFile.peek improvements, suggested by Nir Aides.
Diffstat (limited to 'Doc/library/gzip.rst')
-rw-r--r--Doc/library/gzip.rst14
1 files changed, 11 insertions, 3 deletions
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
index 0ae23d2..82f10b9 100644
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -70,6 +70,17 @@ The module defines the following items:
including iteration and the :keyword:`with` statement. Only the
:meth:`truncate` method isn't implemented.
+ :class:`GzipFile` also provides the following method:
+
+ .. method:: peek([n])
+
+ Read *n* uncompressed bytes without advancing the file position.
+ At most one single read on the compressed stream is done to satisfy
+ the call. The number of bytes returned may be more or less than
+ requested.
+
+ .. versionadded:: 3.2
+
.. versionchanged:: 3.1
Support for the :keyword:`with` statement was added.
@@ -79,9 +90,6 @@ 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)