This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: zlib.compressobj level default value documentation
Type: Stage: resolved
Components: Documentation, Extension Modules Versions: Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, martin.panter, nadeem.vawda, palaviv, python-dev, twouters
Priority: normal Keywords: patch

Created on 2016-01-30 18:48 by palaviv, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
zlib-compressobj-level-doc.patch palaviv, 2016-01-30 18:48 review
zlib-compressobj-level-doc2.patch palaviv, 2016-01-31 17:43 patch after martin review review
Messages (6)
msg259267 - (view) Author: Aviv Palivoda (palaviv) * Date: 2016-01-30 18:48
In the zlib.compressobj documentation the default value of the compress level is -1 while it is actually 6.

patch is included
msg259269 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-01-30 21:00
I’m not sure that is perfectly correct. It really does default to -1, and that is passed to the underlying zlib library (-1 = Z_DEFAULT_COMPRESSION). It is the zlib library that decides that this means 6, but in theory I guess it could be configured or modified in the future with a different default. Perhaps we should clarify the text in the documentation (including the doc string) to say this instead?

At the very least, the documentation should continue to say that -1 is acceptable, and what it means.
msg259289 - (view) Author: Aviv Palivoda (palaviv) * Date: 2016-01-31 17:43
I think that we can leave the level=-1 as the default in the documentation. What should be added is what Z_DEFAULT_COMPRESSION means.
I tried to be as close as possible to the zlib module documentation.
msg259302 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-01-31 22:00
This version looks great to me.
msg259367 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-02-02 07:52
New changeset 650cf38fba28 by Martin Panter in branch '2.7':
Issue #26244: Clarify default zlib compression level in documentation
https://hg.python.org/cpython/rev/650cf38fba28

New changeset 950e0bfe94ae by Martin Panter in branch '3.5':
Issue #26244: Clarify default zlib compression level in documentation
https://hg.python.org/cpython/rev/950e0bfe94ae

New changeset 03708c680eca by Martin Panter in branch 'default':
Issue #26244: Merge zlib documentation from 3.5
https://hg.python.org/cpython/rev/03708c680eca
msg259373 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-02-02 09:57
I also made a small change to the compressobj() doc string.
History
Date User Action Args
2022-04-11 14:58:27adminsetgithub: 70432
2016-02-02 09:57:19martin.pantersetstatus: open -> closed
resolution: fixed
messages: + msg259373

stage: patch review -> resolved
2016-02-02 07:52:41python-devsetnosy: + python-dev
messages: + msg259367
2016-01-31 22:00:18martin.pantersetmessages: + msg259302
versions: + Python 2.7
2016-01-31 17:43:24palavivsetfiles: + zlib-compressobj-level-doc2.patch

messages: + msg259289
2016-01-30 21:00:40martin.pantersetversions: + Python 3.5
nosy: + martin.panter

messages: + msg259269

stage: patch review
2016-01-30 18:48:48palavivcreate