diff options
author | Gregory P. Smith <greg@krypto.org> | 2024-01-12 20:15:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-12 20:15:05 (GMT) |
commit | b44b9d99004f096619c962a8b42a19322f6a441b (patch) | |
tree | f9f32f7eeac3ec7da168e23946365dfb024a4c37 /Doc/library/zipfile.rst | |
parent | ac92527c08d917dffdb9c0a218d06f21114614a2 (diff) | |
download | cpython-b44b9d99004f096619c962a8b42a19322f6a441b.zip cpython-b44b9d99004f096619c962a8b42a19322f6a441b.tar.gz cpython-b44b9d99004f096619c962a8b42a19322f6a441b.tar.bz2 |
gh-113971: Make `zipfile.ZipInfo._compresslevel` public as `.compress_level` (#113969)
Make zipfile.ZipInfo.compress_level public.
A property is used to retain the behavior of the ._compresslevel.
People constructing zipfile.ZipInfo instances to pass into existing APIs to control per-file compression levels already treat this as public, there was never a reason for it not to be.
I used the more modern name compress_level instead of compresslevel as the keyword argument on other ZipFile APIs is called to be consistent with compress_type and a general long term preference of not runningwordstogether without a separator in names.
Diffstat (limited to 'Doc/library/zipfile.rst')
-rw-r--r-- | Doc/library/zipfile.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index a77e49a..c70f2ec 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -79,6 +79,11 @@ The module defines the following items: of the last modification to the file; the fields are described in section :ref:`zipinfo-objects`. + .. versionadded:: 3.13 + A public ``.compress_level`` attribute has been added to expose the + formerly protected ``._compresslevel``. The older protected name + continues to work as a property for backwards compatibility. + .. function:: is_zipfile(filename) Returns ``True`` if *filename* is a valid ZIP file based on its magic number, |