Skip to content

Conversation

@ZeroIntensity
Copy link
Member

@ZeroIntensity ZeroIntensity commented Nov 8, 2025

Copy link
Contributor

@sharktide sharktide left a 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

Copy link
Contributor

@sharktide sharktide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case it looks fine to me / LGTM

available as :class:`types.BuiltinFunctionType` in the Python layer.
.. c:function:: int PyCFunction_Check(PyObject *f)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep a consistent name for the parameter. For _Check functions, I would prefer having op everywhere.

.. c:function:: PyCFunction PyCFunction_GetFunction(PyObject *func)
Get the function pointer on *func* as it was passed to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please indicate whether passing a non-function object sets an exception or causes a crash (to make the distinction with PyCFunction_GET_FUNCTION)

Comment on lines 555 to 556
to the first argument of a :c:type:`PyCFunction`. In modules, this is the
module object.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"In modules, this is the module object" is unclear. I would either say "For modules"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know what you think of the new wording.

.. c:function:: int PyCFunction_Check(PyObject *f)
Return true if *f* is an instance of the :c:type:`PyCFunction_Type` type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, is it the standard formulation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised by the "instance of the X type". I would have just said "instance of X" but if we use the same sentence everywhere else, I'd prefer consistency.

ZeroIntensity and others added 4 commits November 15, 2025 14:06
Comment on lines +527 to +528
If *func* is not a C function object, this fails with a
:class:`SystemError`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is a regular exception right? so no need to mention it. What I wanted to know is whether passing func == NULL produced a SIGSEGV or a Python exception. Since passing NULL is "allowed" (but raises an exception) it's fine to remove the mention to SystemError.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My advice is: check other Check functions to see how we formulate this. I don't want to be too pedantic but I want to be consistent in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants