]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-113971: Make `zipfile.ZipInfo._compresslevel` public as `.compress_level` (#113969)
authorGregory P. Smith <greg@krypto.org>
Fri, 12 Jan 2024 20:15:05 +0000 (12:15 -0800)
committerGitHub <noreply@github.com>
Fri, 12 Jan 2024 20:15:05 +0000 (20:15 +0000)
commitb44b9d99004f096619c962a8b42a19322f6a441b
treef9f32f7eeac3ec7da168e23946365dfb024a4c37
parentac92527c08d917dffdb9c0a218d06f21114614a2
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.
Doc/library/zipfile.rst
Lib/test/test_zipfile/test_core.py
Lib/zipfile/__init__.py
Misc/NEWS.d/next/Library/2024-01-11-16-58-10.gh-issue-113971.skJZ4g.rst [new file with mode: 0644]