-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
chore: decimal module macro cleanup #123791
chore: decimal module macro cleanup #123791
Conversation
This replaces the usages of the `UNUSED` macro which was not consistent with the `Py_UNUSED` macro itself. In addition, this amends the parameter names so that they match their semantic meanings.
cc @vstinner since you were the one reviewing my |
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.
LGTM
Note: I prefer to not review draft PRs in general. |
Oh sorry for that. I'll keep in mind in the future! |
In general, I dislike PRs which only change coding style, but reusing the Py_UNUSED() macro is a good thing. |
When I looked at the refleaks in the decimal module, I observed that some macros are not protected against dangling else and that
UNUSED
does not matchPy_UNUSED
.I didn't want to make two different PRs (though I can cherry-pick the commits since they are easy separated); nevertheless, I think the
do-while
protection should be included (I've already done this kind of PRs in the past).There are some casts are redundant and one argument that was marked as unused but that was not! Some methods used 'args' but were using the
METH_NOARGS
(so it could be confusing to users!) flag. There is one exception beingdec_copy
which both uses aMETH_NOARGS
andMETH_O
flag for__copy__
and__deepcopy__
respectively. I left it asdummy
but added a small comment.