Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Doc/library/zlib.rst

    r2 r391  
    2020information.
    2121
    22 For reading and writing ``.gz`` files see the :mod:`gzip` module. For
    23 other archive formats, see the :mod:`bz2`, :mod:`zipfile`, and
    24 :mod:`tarfile` modules.
     22For reading and writing ``.gz`` files see the :mod:`gzip` module.
    2523
    2624The available exception and functions in this module are:
     
    6563
    6664   Compresses the data in *string*, returning a string contained compressed data.
    67    *level* is an integer from ``1`` to ``9`` controlling the level of compression;
     65   *level* is an integer from ``0`` to ``9`` controlling the level of compression;
    6866   ``1`` is fastest and produces the least compression, ``9`` is slowest and
    69    produces the most.  The default value is ``6``.  Raises the :exc:`error`
    70    exception if any error occurs.
    71 
    72 
    73 .. function:: compressobj([level])
     67   produces the most.  ``0`` is no compression.  The default value is ``6``.
     68   Raises the :exc:`error` exception if any error occurs.
     69
     70
     71.. function:: compressobj([level[, method[, wbits[, memlevel[, strategy]]]]])
    7472
    7573   Returns a compression object, to be used for compressing data streams that won't
    76    fit into memory at once.  *level* is an integer from ``1`` to ``9`` controlling
     74   fit into memory at once.  *level* is an integer from ``0`` to ``9`` controlling
    7775   the level of compression; ``1`` is fastest and produces the least compression,
    78    ``9`` is slowest and produces the most.  The default value is ``6``.
     76   ``9`` is slowest and produces the most.  ``0`` is no compression.  The default
     77   value is ``6``.
     78
     79   *method* is the compression algorithm. Currently, the only supported value is
     80   ``DEFLATED``.
     81
     82   *wbits* is the base two logarithm of the size of the window buffer. This
     83   should be an integer from ``8`` to ``15``. Higher values give better
     84   compression, but use more memory. The default is 15.
     85
     86   *memlevel* controls the amount of memory used for internal compression state.
     87   Valid values range from ``1`` to ``9``. Higher values using more memory,
     88   but are faster and produce smaller output. The default is 8.
     89
     90   *strategy* is used to tune the compression algorithm. Possible values are
     91   ``Z_DEFAULT_STRATEGY``, ``Z_FILTERED``, and ``Z_HUFFMAN_ONLY``. The default
     92   is ``Z_DEFAULT_STRATEGY``.
    7993
    8094
     
    116130   Decompresses the data in *string*, returning a string containing the
    117131   uncompressed data.  The *wbits* parameter controls the size of the window
    118    buffer.  If *bufsize* is given, it is used as the initial size of the output
     132   buffer, and is discussed further below.
     133   If *bufsize* is given, it is used as the initial size of the output
    119134   buffer.  Raises the :exc:`error` exception if any error occurs.
    120135
     
    123138   value should be between 8 and 15 for the most recent versions of the zlib
    124139   library, larger values resulting in better compression at the expense of greater
    125    memory usage.  The default value is 15.  When *wbits* is negative, the standard
    126    :program:`gzip` header is suppressed; this is an undocumented feature of the
    127    zlib library, used for compatibility with :program:`unzip`'s compression file
    128    format.
     140   memory usage.  When decompressing a stream, *wbits* must not be smaller
     141   than the size originally used to compress the stream; using a too-small
     142   value will result in an exception. The default value is therefore the
     143   highest value, 15.  When *wbits* is negative, the standard
     144   :program:`gzip` header is suppressed.
    129145
    130146   *bufsize* is the initial size of the buffer used to hold decompressed data.  If
    131147   more space is required, the buffer size will be increased as needed, so you
    132148   don't have to get this value exactly right; tuning it will only save a few calls
    133    to :cfunc:`malloc`.  The default size is 16384.
     149   to :c:func:`malloc`.  The default size is 16384.
    134150
    135151
Note: See TracChangeset for help on using the changeset viewer.