summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-02-10 10:06:36 +0000
committerMartin Panter <vadmium+py@gmail.com>2016-02-10 10:06:36 +0000
commit1fe0d13d1246b5d60a4f4fb8c627babd0e94ab87 (patch)
treeeec6386513c0eaa44a9277b472cc2d4e6a53871b /Doc
parent38418662e0339b6331e0c7e00ea55f41b28bf38d (diff)
downloadcpython-git-1fe0d13d1246b5d60a4f4fb8c627babd0e94ab87.tar.gz
Issue #26243: zlib.compress() keyword argument support by Aviv Palivoda
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/zlib.rst11
-rw-r--r--Doc/whatsnew/3.6.rst7
2 files changed, 15 insertions, 3 deletions
diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst
index 1869bb8aac..09026cb155 100644
--- a/Doc/library/zlib.rst
+++ b/Doc/library/zlib.rst
@@ -46,14 +46,19 @@ The available exception and functions in this module are:
platforms, use ``adler32(data) & 0xffffffff``.
-.. function:: compress(data[, level])
+.. function:: compress(data, level=-1)
Compresses the bytes in *data*, returning a bytes object containing compressed data.
- *level* is an integer from ``0`` to ``9`` controlling the level of compression;
+ *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``.
+ produces the most. ``0`` is no compression. The default value is ``-1``
+ (Z_DEFAULT_COMPRESSION). Z_DEFAULT_COMPRESSION represents a default
+ compromise between speed and compression (currently equivalent to level 6).
Raises the :exc:`error` exception if any error occurs.
+ .. versionchanged:: 3.6
+ Keyword arguments are now supported.
+
.. function:: compressobj(level=-1, method=DEFLATED, wbits=15, memLevel=8, strategy=Z_DEFAULT_STRATEGY[, zdict])
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
index b7cc159666..87199df32b 100644
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -150,6 +150,13 @@ to check if the :class:`~zipfile.ZipInfo` instance represents a directory.
(Contributed by Thomas Kluyver in :issue:`26039`.)
+zlib
+----
+
+The :func:`~zlib.compress` function now accepts keyword arguments.
+(Contributed by Aviv Palivoda in :issue:`26243`.)
+
+
Optimizations
=============