-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-132983: Style improvements for compression.zstd
#133547
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
Mostly just make both files consistently use single vs double quotes. Also add a missing space in a multi-line string.
pythonGH-133479 removed the logic to check for libzstd outside of pkg-config. This commit adds that logic back with a check for the version so that users can provide their own libzstd. This is to bring parity with lzma, bz2, and zlib detection.
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.
I am confirming you did not miss any '
, except maybe in the docstring of ZstdFile.readline
which mentions b''
Yeah I left that one intentionally as docs seem to use |
@AA-Turner @gpshead pinging just to follow up on the request for review on this one. |
I would argue that the (C)Python house style is to use single quotes, as that matches the output of repr and thus the REPL. Formatters like black took position for double quotes for various reasons (I think arguing that it’s more common to have apostrophes inside the quotes, and something about qwerty layout), but that’s not universally liked. So this change could be done (the files already have a non-small git history!), or not done. |
Bringing here a suggestion from a closed PR: avoid unnecessary packages for the re-exported compression sub-modules (rename |
This better matches CPython's style
This was missed when adding Zstandard support.
Moved the modules and changed to single quotes! I also added a trailing comma that @merwok noted in an already-merged PR. I also updated the PR description to cover these points. |
Thanks @emmatyping for the PR, and @AA-Turner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
GH-134001 is a backport of this pull request to the 3.14 branch. |
Mostly just make both files consistently use single vs double quotes and add spacing as suggested in PEP 8.
tarfile