]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #26244: Clarify default zlib compression level in documentation
authorMartin Panter <vadmium+py@gmail.com>
Wed, 3 Feb 2016 07:06:33 +0000 (07:06 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Wed, 3 Feb 2016 07:06:33 +0000 (07:06 +0000)
Based on patch by Aviv Palivoda.

Doc/library/zlib.rst
Misc/ACKS
Modules/zlibmodule.c

index 96e723bfe54c88db540a5d5d9d972d96cf760a85..26b0dfc83225956dc239ca389d51f71322662059 100644 (file)
@@ -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``.
index 0a71085551f5f32408c94338c8ed8b76f7008ba2..df59e122aec99e957dff5bee9fbf23e37241efb2 100644 (file)
--- 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
index 74aad7cf0b1224b7933274b4110ab9f69482a56b..8c7916eb0158a2058a47361d54b23fcb7a288ee7 100644 (file)
@@ -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"