FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-113971: Make `zipfile.ZipInfo._compresslevel` public as `.compress_level` by gpshead · Pull Request #113969 · python/cpython · GitHub

Repository navigation

gh-113971: Make zipfile.ZipInfo._compresslevel public as .compress_level - #113969

Merged
gpshead merged 7 commits into
python:mainfrom
gpshead:zipfile/ZipInfo.compress_level
Jan 12, 2024
Merged

gpshead merged 7 commits into
python:mainfrom
gpshead:zipfile/ZipInfo.compress_level

Conversation

gpshead commented Jan 12, 2024 •
edited
Loading

Copy link
Copy Markdown
Member

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. The zipfile module 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/

Fixes #113971
Closes #113971

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.
gpshead added the type-feature A feature request or enhancement label Jan 12, 2024
gpshead self-assigned this Jan 12, 2024
gpshead changed the title gh-TODO: Make zipfile.ZipInfo._compresslevel public as .compress_level gh-113971: Make zipfile.ZipInfo._compresslevel public as .compress_level Jan 12, 2024
gpshead marked this pull request as ready for review January 12, 2024 01:14

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Does it need a What's New entry?

Comment thread Lib/test/test_zipfile/test_core.py Outdated

gpshead commented Jan 12, 2024

Copy link
Copy Markdown
Member Author

Does it need a What's New entry?

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

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM.

gpshead merged commit b44b9d9 into python:main Jan 12, 2024
gpshead deleted the zipfile/ZipInfo.compress_level branch January 13, 2024 01:53
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

Labels

type-feature A feature request or enhancement

Projects

Development

Successfully merging this pull request may close these issues.

zipfile.ZipInfo._compresslevel should be public.

3 participants


Back | FazBrowse Home | New Git URL