-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Fix typo in Py_DECREF comment
#128387
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
Fix typo in Py_DECREF comment
#128387
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
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.
Why change a comment that is wrong to one that is also wrong?
This is explained in a previous comment in the file:
If it may be NULL, use Py_XINCREF/Py_XDECREF instead.
I think this comment should be completely changed or removed.
|
The comment is more for internal purposes and implementation details explaining why we are using The caller is not meant to pass |
|
Indeed this appears to me to be the case. |
Py_DECREF comment
|
@vstinner I plan to merge this one without a commit message and the title as the commit title. If you however think it's not needed, we can also close this PR (strictly speaking, the comment is also correct but weird considering the implementation and was likely a C/C error). |
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. I confirm that I made a stupid copy/paste mistake here.
|
@vstinner In general, we backports docs fixes but by docs I mean docs in pure Python/rst docs. I barely encounter docs fixes at the C level, so do you want to backport this change? |
|
I don't think that it's worth it to backport such change. |
Py_DECREF's comment incorrectly references_Py_IncRefwhich isn't used by decref. Both functions don't accept NULL but only_Py_DecRefis relevant for the decref function