-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
gh-141004: Document missing PyCFunction* and PyCMethod* APIs
#141253
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?
gh-141004: Document missing PyCFunction* and PyCMethod* APIs
#141253
Conversation
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 suggested some updates so the tone is consistent (eg. We use trailing "s" chars like "returns" but we use "Get" instead of "Gets") so we should keep the same style for consistency and to improve reading flow
I also surrounded true and false with backticks
| .. c:function:: int PyCMethod_Check(PyObject *f) | ||
| Return true if *f* is an instance of the :c:type:`PyCMethod_Type` type |
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.
| Return true if *f* is an instance of the :c:type:`PyCMethod_Type` type | |
| Returns ``true`` if *f* is an instance of the :c:type:`PyCMethod_Type` type. Otherwise returns ``false``. |
| Return true if *f* is an instance of the :c:type:`PyCFunction_Type` type | ||
| or a subtype of it. This function always succeeds. |
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.
| Return true if *f* is an instance of the :c:type:`PyCFunction_Type` type | |
| or a subtype of it. This function always succeeds. | |
| Returns ``true`` if *f* is an instance of the :c:type:`PyCFunction_Type` type | |
| or a subtype of it. Otherwise returns ``false``. This function always succeeds. |
| .. c:function:: int PyCFunction_GetFlags(PyObject *func) | ||
| Get the function flags on *func* as they were passed to |
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.
| Get the function flags on *func* as they were passed to | |
| Gets the function flags on *func* as they were passed to |
| .. c:function:: PyCFunction PyCFunction_GetFunction(PyObject *func) | ||
| Get the function pointer on *func* as it was passed to |
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.
| Get the function pointer on *func* as it was passed to | |
| Gets the function pointer on *func* as it was passed to |
| .. c:function:: PyObject *PyCFunction_GetSelf(PyObject *func) | ||
| Get the "self" object on *func*. This is the object that would be passed |
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.
| Get the "self" object on *func*. This is the object that would be passed | |
| Gets the "self" object on *func*. This is the object that would be passed |
📚 Documentation preview 📚: https://cpython-previews--141253.org.readthedocs.build/en/141253/c-api/structures.html#implementing-functions-and-methods