gh-113971: Make zipfile.ZipInfo._compresslevel public as .compress_level - #113969
Merged
Conversation
A property is used to retain the behavior of the `._compresslevel`. People constructing ZipInfo instances to pass in to control per-file compression levels already treat this as public, there was never a reason for it not to be.
zipfile.ZipInfo._compresslevel public as .compress_levelzipfile.ZipInfo._compresslevel public as .compress_level
erlend-aasland
approved these changes
Jan 12, 2024
serhiy-storchaka
left a comment
Member
There was a problem hiding this comment.
Does it need a What's New entry?
Member
Author
I don't think so for this one, the old way to set this attribute will continue to work forever and ZipInfo isn't even properly fully documented so a what's new entry seems like too much attention. |
gpshead
enabled auto-merge (squash)
January 12, 2024 20:05
kulikjak
pushed a commit
to kulikjak/cpython
that referenced
this pull request
Jan 22, 2024
…mpress_level` (python#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.
aisk
pushed a commit
to aisk/cpython
that referenced
this pull request
Feb 11, 2024
…mpress_level` (python#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.
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this pull request
Sep 2, 2024
…mpress_level` (python#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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Make
zipfile.ZipInfo.compress_levelpublic.A property is used to retain the behavior of the
._compresslevel.People constructing
zipfile.ZipInfoinstances 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_levelinstead ofcompresslevelas the keyword argument on otherZipFileAPIs is called to be consistent withcompress_typeand a general long term preference of not runningwordstogether without a separator in names. Thezipfilemodule APIs already have a variety of style inconsistencies, I don't think this makes anything worse. Someone typing the wrong one in either place will get an immediate exception.📚 Documentation preview 📚: https://cpython-previews--113969.org.readthedocs.build/
zipfile.ZipInfo._compresslevelshould be public. #113971Fixes #113971
Closes #113971