summaryrefslogtreecommitdiffstats
path: root/Doc/library/zlib.rst
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2012-06-21 23:40:49 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2012-06-21 23:40:49 (GMT)
commit2180c97a0055c8c2f6f2cf0754bfb650d7cc0f34 (patch)
treebb3046c556ba28f862e870d34e2b5b11c3d9e649 /Doc/library/zlib.rst
parentcf5e1d82e3c0910f094727b6ef8e2a63da9ed8cf (diff)
downloadcpython-2180c97a0055c8c2f6f2cf0754bfb650d7cc0f34.zip
cpython-2180c97a0055c8c2f6f2cf0754bfb650d7cc0f34.tar.gz
cpython-2180c97a0055c8c2f6f2cf0754bfb650d7cc0f34.tar.bz2
Document the rest of zlib.compressobj()'s arguments.
Original patch by Jim Jewett; see issue 14684.
Diffstat (limited to 'Doc/library/zlib.rst')
-rw-r--r--Doc/library/zlib.rst22
1 files changed, 18 insertions, 4 deletions
diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst
index 705f734..30f1537 100644
--- a/Doc/library/zlib.rst
+++ b/Doc/library/zlib.rst
@@ -58,14 +58,28 @@ The available exception and functions in this module are:
exception if any error occurs.
-.. function:: compressobj([level[, method[, wbits[, memlevel[, strategy[, zdict]]]]]])
+.. function:: compressobj(level=-1, method=DEFLATED, wbits=15, memlevel=8, strategy=Z_DEFAULT_STRATEGY, [zdict])
Returns a compression object, to be used for compressing data streams that won't
fit into memory at once.
- *level* is an integer from ``1`` to ``9`` controlling the level of
- compression; ``1`` is fastest and produces the least compression, ``9`` is
- slowest and produces the most. The default value is ``6``.
+ *level* is the compression level -- an integer from ``1`` to ``9``. A value
+ of ``1`` is fastest and produces the least compression, while a value of
+ ``9`` is slowest and produces the most. The default value is ``6``.
+
+ *method* is the compression algorithm. Currently, the only supported value is
+ ``DEFLATED``.
+
+ *wbits* is the base two logarithm of the size of the window buffer. This
+ should be an integer from ``8`` to ``15``. Higher values give better
+ compression, but use more memory.
+
+ *memlevel* controls the amount of memory used for internal compression state.
+ Valid values range from ``1`` to ``9``. Higher values using more memory,
+ but are faster and produce smaller output.
+
+ *strategy* is used to tune the compression algorithm. Possible values are
+ ``Z_DEFAULT_STRATEGY``, ``Z_FILTERED``, and ``Z_HUFFMAN_ONLY``.
*zdict* is a predefined compression dictionary. This is a sequence of bytes
(such as a :class:`bytes` object) containing subsequences that are expected