-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-132983: Split _zstd_set_c_parameters
#133921
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
3271d2c
to
d44dd9b
Compare
No, there is not. You cannot distinguish the passed value from the default value. It is better to not using Argument Clinic for conversion of this parameter. BTW, |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
# Conflicts: # Modules/_zstd/compressor.c
When you're done making the requested changes, leave the comment: |
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.
A few suggestions for wording of error messages, but I think otherwise this looks great. Thank you for refactoring this!
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.
Thanks, this is a great refactor!
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 not sure about term "illegal", this is a question to native speakers, but the rest LGTM. Thank you.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
It's not wrong, but perhaps invalid is better? |
Thanks @AA-Turner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
(cherry picked from commit 11f7a93) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
GH-134838 is a backport of this pull request to the 3.14 branch. |
The current
_zstd_set_c_parameters
shares little between the two possible (int or dict) paths. By splitting the function, we can now use thePy_ssize_t
AC converter.One slight change worth noting is that the constructor won't raise an error when level is$-2^{63}$ but will just silently use the default. cc @erlend-aasland if there's a better method/sentinel we can use in the clinic to detect if the value has been set or not.
I also think it might be worth considering removing the level XOR options check, as we could adopt the rule that a compression level set in an options dict overrides the level parameter. I can see reasonable arguments to keep the status quo, however, so I've not done this yet.
A
cc @Rogdham