-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
gh-132983: Introduce compression
package and move _compression
module
#133018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit introduces the `compression` package, specified in PEP 784 to re-export the `lzma`, `bz2`, `gzip`, and `zlib` modules. Introduction of `compression.zstd` will be completed in a future commit once the `_zstd` module is merged. This commit also moves the `_compression` private module to `compression._common.streams`.
(You need to run |
Yeah, unfortunately E: s/modules/packages/ |
Also update `generate_stdlib_module_names.py` to collect `compression`, a namespace package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some imports are not sorted but they are part of the test and tests imports don't follow a specific convention (unless we manage to). In general, we try to keep the convention within the same file.
Good to know, sorry I am not very familiar with the import ordering conventions! |
Officially, there is no convention so it's fine! The modules I maintain have sorted imports because it's easier to find what I want but other modules have what I call chronological imports (i.e., once you need another module, a new line is added). There are benefits in both: the first is "purer" (although it's subjective) while the latter eases diffs. I try to minimize the diffs in general even if it goes against my own conventions (and minimizing the diff is generally achieved by keeping the same convention as the current file). |
46c7e21
to
2e1b2a8
Compare
|
Fails are related. |
Yes, it looks like I need to add the |
|
PR with fix: #133063 |
This is part 1 of the Implementation Plan for PEP 784.
This change:
compression
package and re-exports existing modules under that package.Lib/_compression.py
toLib/compression/_common/streams.py
and updates imports to match.I added
skip news
as I'd like to write a holistic NEWS/What's New entry once the entire implementation has landed. If people think each PR should have NEWS I can write something up.