-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Make it clear Py_VISIT is a macro in the docs #133688
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
It has the hidden return inside it, so to me the `void` return type is a little misleading because it implies that it behaves like a C function.
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.
There are a few other places where a function is documented instead of a macro, e.g. any of the reference count APIs. I'm not opposed to changing everything, but what's the benefit here?
Oh wait, bad example--the reference count APIs are |
My opinion is that most of the reference counting API could be substituted for a function (and in some cases, has been). The ones that really couldn't be replaced by a function like
My opinion would be that I don't feel hugely strongly about this - I'm not going to argue if you don't think it's an improvement. But that's the reasoning for why I proposed the change. |
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.
Ok, yeah, let's go with this. Py_VISIT
can return the caller, which isn't at all clear when it's documented as a function. Let's also fix Py_CLEAR
in a follow-up.
Thanks @da-woods for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
(cherry picked from commit bb32f3c) Co-authored-by: da-woods <[email protected]>
(cherry picked from commit bb32f3c) Co-authored-by: da-woods <[email protected]>
GH-134186 is a backport of this pull request to the 3.14 branch. |
GH-134187 is a backport of this pull request to the 3.13 branch. |
document `Py_VISIT` as a macro in the docs (GH-133688) (cherry picked from commit bb32f3c) Co-authored-by: da-woods <[email protected]>
document `Py_VISIT` as a macro in the docs (GH-133688) (cherry picked from commit bb32f3c) Co-authored-by: da-woods <[email protected]>
It has the hidden return inside it, so to me the
void
return type is a little misleading because it implies that it behaves like a C function.📚 Documentation preview 📚: https://cpython-previews--133688.org.readthedocs.build/