-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-135755: Document the new PyFunction_GET_BUILTINS
macro
#135934
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
base: main
Are you sure you want to change the base?
Conversation
This function cannot fail and does not do error checking; passing anything | ||
other than an instance of :c:data:`PyFunction_Type` is undefined behavior. | ||
There is no ``PyFunction_Get*`` equivalent for this 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.
Hm, I don't think C API WG would approve.
Should this function be in a private header (and with an underscore) instead? It looks untested as well.
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.
It's sort of tested. I'm not opposed to making it private.
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.
That looks like it's used in a test -- the test assumes that it's working?
Yeah, the more I look into it, the better making it private seems.
cc @ericsnowcurrently, who added PyFunction_GET_BUILTINS
in #133128
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'll put up an alternate PR.
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.
FWIW, I agree with making it internal-only.
📚 Documentation preview 📚: https://cpython-previews--135934.org.readthedocs.build/