Skip to content

Commit 5424dab

Browse files
StanFromIrelandhugovkvstinner
authored
[3.13] gh-101100: Document zlib public constants to fix reference warnings (GH-139835) (#139912)
* gh-101100: Document `zlib` public constants to fix reference warnings (#139835) Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Victor Stinner <[email protected]> (cherry picked from commit c7f1da9) * [3.13] gh-101100: Document `zlib` public constants to fix reference warnings (GH-139835) (cherry picked from commit c7f1da9) Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Victor Stinner <[email protected]> --------- Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
1 parent 70ae4c8 commit 5424dab

File tree

2 files changed

+133
-4
lines changed

2 files changed

+133
-4
lines changed

Doc/library/zlib.rst

Lines changed: 133 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ earlier than 1.1.3; 1.1.3 has a `security vulnerability <https://zlib.net/zlib_f
1616

1717
zlib's functions have many options and often need to be used in a particular
1818
order. This documentation doesn't attempt to cover all of the permutations;
19-
consult the zlib manual at http://www.zlib.net/manual.html for authoritative
19+
consult the `zlib manual <https://www.zlib.net/manual.html>`_ for authoritative
2020
information.
2121

2222
For reading and writing ``.gz`` files see the :mod:`gzip` module.
@@ -312,6 +312,136 @@ Decompression objects support the following methods and attributes:
312312
objects.
313313

314314

315+
The following constants are available to configure compression and decompression
316+
behavior:
317+
318+
.. data:: DEFLATED
319+
320+
The deflate compression method.
321+
322+
323+
.. data:: MAX_WBITS
324+
325+
The maximum window size, expressed as a power of 2.
326+
For example, if :const:`!MAX_WBITS` is ``15`` it results in a window size
327+
of ``32 KiB``.
328+
329+
330+
.. data:: DEF_MEM_LEVEL
331+
332+
The default memory level for compression objects.
333+
334+
335+
.. data:: DEF_BUF_SIZE
336+
337+
The default buffer size for decompression operations.
338+
339+
340+
.. data:: Z_NO_COMPRESSION
341+
342+
Compression level ``0``.
343+
344+
.. versionadded:: 3.6
345+
346+
347+
.. data:: Z_BEST_SPEED
348+
349+
Compression level ``1``.
350+
351+
352+
.. data:: Z_BEST_COMPRESSION
353+
354+
Compression level ``9``.
355+
356+
357+
.. data:: Z_DEFAULT_COMPRESSION
358+
359+
Default compression level (``-1``).
360+
361+
362+
.. data:: Z_DEFAULT_STRATEGY
363+
364+
Default compression strategy, for normal data.
365+
366+
367+
.. data:: Z_FILTERED
368+
369+
Compression strategy for data produced by a filter (or predictor).
370+
371+
372+
.. data:: Z_HUFFMAN_ONLY
373+
374+
Compression strategy that forces Huffman coding only.
375+
376+
377+
.. data:: Z_RLE
378+
379+
Compression strategy that limits match distances to one (run-length encoding).
380+
381+
This constant is only available if Python was compiled with zlib
382+
1.2.0.1 or greater.
383+
384+
.. versionadded:: 3.6
385+
386+
387+
.. data:: Z_FIXED
388+
389+
Compression strategy that prevents the use of dynamic Huffman codes.
390+
391+
This constant is only available if Python was compiled with zlib
392+
1.2.2.2 or greater.
393+
394+
.. versionadded:: 3.6
395+
396+
397+
.. data:: Z_NO_FLUSH
398+
399+
Flush mode ``0``. No special flushing behavior.
400+
401+
.. versionadded:: 3.6
402+
403+
404+
.. data:: Z_PARTIAL_FLUSH
405+
406+
Flush mode ``1``. Flush as much output as possible.
407+
408+
409+
.. data:: Z_SYNC_FLUSH
410+
411+
Flush mode ``2``. All output is flushed and the output is aligned to a byte boundary.
412+
413+
414+
.. data:: Z_FULL_FLUSH
415+
416+
Flush mode ``3``. All output is flushed and the compression state is reset.
417+
418+
419+
.. data:: Z_FINISH
420+
421+
Flush mode ``4``. All pending input is processed, no more input is expected.
422+
423+
424+
.. data:: Z_BLOCK
425+
426+
Flush mode ``5``. A deflate block is completed and emitted.
427+
428+
This constant is only available if Python was compiled with zlib
429+
1.2.2.2 or greater.
430+
431+
.. versionadded:: 3.6
432+
433+
434+
.. data:: Z_TREES
435+
436+
Flush mode ``6``, for inflate operations. Instructs inflate to return when
437+
it gets to the next deflate block boundary.
438+
439+
This constant is only available if Python was compiled with zlib
440+
1.2.3.4 or greater.
441+
442+
.. versionadded:: 3.6
443+
444+
315445
Information about the version of the zlib library in use is available through
316446
the following constants:
317447

@@ -335,10 +465,10 @@ the following constants:
335465
Module :mod:`gzip`
336466
Reading and writing :program:`gzip`\ -format files.
337467

338-
http://www.zlib.net
468+
https://www.zlib.net
339469
The zlib library home page.
340470

341-
http://www.zlib.net/manual.html
471+
https://www.zlib.net/manual.html
342472
The zlib manual explains the semantics and usage of the library's many
343473
functions.
344474

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Doc/library/xml.sax.reader.rst
5353
Doc/library/xml.sax.rst
5454
Doc/library/xmlrpc.client.rst
5555
Doc/library/xmlrpc.server.rst
56-
Doc/library/zlib.rst
5756
Doc/reference/compound_stmts.rst
5857
Doc/reference/datamodel.rst
5958
Doc/whatsnew/2.4.rst

0 commit comments

Comments
 (0)