-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-101100: Document zlib
public constants to fix reference warnings
#139835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
StanFromIreland
wants to merge
5
commits into
python:main
Choose a base branch
from
StanFromIreland:zlib-warnings
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9b8bf41
Commit
StanFromIreland a1f2afe
unwrap
StanFromIreland cace71d
Victor's review
StanFromIreland b18c4a7
Merge remote-tracking branch 'origin/zlib-warnings' into zlib-warnings
StanFromIreland ca3e8e4
Victor's suggestion
StanFromIreland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,7 +16,7 @@ earlier than 1.1.3; 1.1.3 has a `security vulnerability <https://zlib.net/zlib_f | |||||
|
||||||
zlib's functions have many options and often need to be used in a particular | ||||||
order. This documentation doesn't attempt to cover all of the permutations; | ||||||
consult the zlib manual at http://www.zlib.net/manual.html for authoritative | ||||||
consult the `zlib manual <https://www.zlib.net/manual.html>`_ for authoritative | ||||||
information. | ||||||
|
||||||
For reading and writing ``.gz`` files see the :mod:`gzip` module. | ||||||
|
@@ -340,6 +340,134 @@ Decompression objects support the following methods and attributes: | |||||
objects. | ||||||
|
||||||
|
||||||
The following constants are available to configure compression and decompression | ||||||
behavior: | ||||||
|
||||||
.. data:: DEFLATED | ||||||
|
||||||
The deflate compression method. | ||||||
|
||||||
|
||||||
.. data:: MAX_WBITS | ||||||
|
||||||
The maximum window buffer size (power of 2). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this wording is slightly misleading, what do others think? |
||||||
|
||||||
|
||||||
.. data:: DEF_MEM_LEVEL | ||||||
|
||||||
The default memory level for compression objects. | ||||||
|
||||||
|
||||||
.. data:: DEF_BUF_SIZE | ||||||
|
||||||
The default buffer size for decompression operations. | ||||||
|
||||||
|
||||||
.. data:: Z_NO_COMPRESSION | ||||||
|
||||||
Compression level ``0``. | ||||||
|
||||||
StanFromIreland marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
.. versionadded:: 3.6 | ||||||
|
||||||
|
||||||
.. data:: Z_BEST_SPEED | ||||||
|
||||||
Compression level ``1``. | ||||||
|
||||||
|
||||||
.. data:: Z_BEST_COMPRESSION | ||||||
|
||||||
Compression level ``9``. | ||||||
|
||||||
|
||||||
.. data:: Z_DEFAULT_COMPRESSION | ||||||
|
||||||
Default compression level (``-1``). | ||||||
|
||||||
|
||||||
.. data:: Z_DEFAULT_STRATEGY | ||||||
|
||||||
Default compression strategy, for normal data. | ||||||
|
||||||
|
||||||
.. data:: Z_FILTERED | ||||||
|
||||||
Compression strategy for data produced by a filter (or predictor). | ||||||
|
||||||
|
||||||
.. data:: Z_HUFFMAN_ONLY | ||||||
|
||||||
Compression strategy that forces Huffman coding only. | ||||||
|
||||||
|
||||||
.. data:: Z_RLE | ||||||
|
||||||
Compression strategy that limits match distances to one (run-length encoding). | ||||||
|
||||||
This constant is only available if Python was compiled with zlib | ||||||
1.2.0.1 or greater. | ||||||
|
||||||
StanFromIreland marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
.. versionadded:: 3.6 | ||||||
|
||||||
|
||||||
.. data:: Z_FIXED | ||||||
|
||||||
Compression strategy that prevents the use of dynamic Huffman codes. | ||||||
|
||||||
This constant is only available if Python was compiled with zlib | ||||||
1.2.2.2 or greater. | ||||||
StanFromIreland marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
.. versionadded:: 3.6 | ||||||
|
||||||
|
||||||
.. data:: Z_NO_FLUSH | ||||||
|
||||||
Flush mode ``0``. No special flushing behavior. | ||||||
|
||||||
.. versionadded:: 3.6 | ||||||
|
||||||
|
||||||
.. data:: Z_PARTIAL_FLUSH | ||||||
|
||||||
Flush mode ``1``. Flush as much output as possible. | ||||||
|
||||||
StanFromIreland marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
.. data:: Z_SYNC_FLUSH | ||||||
|
||||||
Flush mode ``2``. All output is flushed and the output is aligned to a byte boundary. | ||||||
|
||||||
|
||||||
.. data:: Z_FULL_FLUSH | ||||||
|
||||||
Flush mode ``3``. All output is flushed and the compression state is reset. | ||||||
|
||||||
|
||||||
.. data:: Z_FINISH | ||||||
|
||||||
Flush mode ``4``. All pending input is processed, no more input is expected. | ||||||
|
||||||
|
||||||
.. data:: Z_BLOCK | ||||||
|
||||||
Flush mode ``5``. A deflate block is completed and emitted. | ||||||
|
||||||
This constant is only available if Python was compiled with zlib | ||||||
1.2.2.2 or greater. | ||||||
StanFromIreland marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
.. versionadded:: 3.6 | ||||||
|
||||||
|
||||||
.. data:: Z_TREES | ||||||
|
||||||
Flush mode ``6``, for inflate operations. Instructs inflate to return when | ||||||
it gets to the next deflate block boundary. | ||||||
|
||||||
This constant is only available if Python was compiled with zlib | ||||||
1.2.3.4 or greater. | ||||||
|
||||||
StanFromIreland marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
.. versionadded:: 3.6 | ||||||
|
||||||
|
||||||
Information about the version of the zlib library in use is available through | ||||||
the following constants: | ||||||
|
||||||
|
@@ -375,10 +503,10 @@ the following constants: | |||||
Module :mod:`gzip` | ||||||
Reading and writing :program:`gzip`\ -format files. | ||||||
|
||||||
http://www.zlib.net | ||||||
https://www.zlib.net | ||||||
The zlib library home page. | ||||||
|
||||||
http://www.zlib.net/manual.html | ||||||
https://www.zlib.net/manual.html | ||||||
The zlib manual explains the semantics and usage of the library's many | ||||||
functions. | ||||||
|
||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, bare links in source text are recognised by reST (unlike markdown), so this change is optional.