summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-02-03 07:06:33 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-02-03 07:06:33 (GMT)
commit1d269c106740e855cb53f91a27ed85aaf1cf84f5 (patch)
treee5566b59631772f0660a09d556ea68342f588b54
parent886aba4737a8384339baaee82d842b98b09162d0 (diff)
downloadcpython-1d269c106740e855cb53f91a27ed85aaf1cf84f5.zip
cpython-1d269c106740e855cb53f91a27ed85aaf1cf84f5.tar.gz
cpython-1d269c106740e855cb53f91a27ed85aaf1cf84f5.tar.bz2
Issue #26244: Clarify default zlib compression level in documentation
Based on patch by Aviv Palivoda.
-rw-r--r--Doc/library/zlib.rst6
-rw-r--r--Misc/ACKS1
-rw-r--r--Modules/zlibmodule.c2
3 files changed, 6 insertions, 3 deletions
diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst
index 96e723b..26b0dfc 100644
--- a/Doc/library/zlib.rst
+++ b/Doc/library/zlib.rst
@@ -71,10 +71,12 @@ The available exception and functions in this module are:
.. function:: compressobj([level[, method[, wbits[, memlevel[, strategy]]]]])
Returns a compression object, to be used for compressing data streams that won't
- fit into memory at once. *level* is an integer from ``0`` to ``9`` controlling
+ fit into memory at once. *level* is an integer from
+ ``0`` to ``9`` or ``-1``, controlling
the level of compression; ``1`` is fastest and produces the least compression,
``9`` is slowest and produces the most. ``0`` is no compression. The default
- value is ``6``.
+ value is ``-1`` (Z_DEFAULT_COMPRESSION). Z_DEFAULT_COMPRESSION represents a default
+ compromise between speed and compression (currently equivalent to level 6).
*method* is the compression algorithm. Currently, the only supported value is
``DEFLATED``.
diff --git a/Misc/ACKS b/Misc/ACKS
index 0a71085..df59e12 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1019,6 +1019,7 @@ Joonas Paalasmaa
Martin Packman
Shriphani Palakodety
Julien Palard
+Aviv Palivoda
Ondrej Palkovsky
Mike Pall
Todd R. Palmer
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index 74aad7c..8c7916e 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -101,7 +101,7 @@ zlib_error(z_stream zst, int err, char *msg)
PyDoc_STRVAR(compressobj__doc__,
"compressobj([level]) -- Return a compressor object.\n"
"\n"
-"Optional arg level is the compression level, in 0-9.");
+"Optional arg level is the compression level, in 0-9 or -1.");
PyDoc_STRVAR(decompressobj__doc__,
"decompressobj([wbits]) -- Return a decompressor object.\n"