GeezerVison is showing github.com — gh-132983: Clean-ups for `_zstd` by AA-Turner · Pull Request #133670 · python/cpython
Conversation
AA-Turner
commented
May 8, 2025
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
cc @Rogdham (can't request review).
Best reviewed commit-by-commit.
This contains several clean-ups for the _zstd module.
_compressionLevel_values is replaced with a single int constant, the default compression level
zstd_version_info is initialised from the macros, removing version decomposition arithmetic
- remove the unused
_ZSTD_CStreamSizes
- Replace
_ZSTD_DStreamSizes with ZSTD_DStreamOutSize
- Remove unused
_ZSTD_Config
- Remove zstd version string from error messages -- it is inconsistently used, and the version can be found from the module-level variables
- small refactoring of
set_zstd_error()
- Inline the
add_parameters function and use the existing PyModule_AddIntMacro rather than defining a local equivalent
- Remove the leading underscore from several constants in an already private module, use an explicit list of names for the re-exporting in
compression.zstd
A
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Rogdham
commented
May 8, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
I read through your commits and have no objections, but I don't feel confident enough to review this on my own.
Did you decide to leave functions of _zstd module with a leading underscore on purpose? (_train_dict/_finalize_dict/_get_param_bounds/_get_frame_info/_set_parameter_types) I have no opinion on it, I'm just curious.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Good question -- this PR was getting too big, so I just submitted the changes to the module-level constants. I intend to go through the functions in a follow-up.
A
|
Rogdham and emmatyping reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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 have one request but otherwise I think these changes look like great clean ups. Thanks!
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @AA-Turner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
picnixz
picnixz approved these changes
+2 more reviewers
Rogdham
Rogdham left review comments
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|