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.

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.

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.

Copy link
Member Author

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.

Ah, ok. NULL will result in a SIGSEGV, but a non-function will result in a SystemError. I updated the text to hopefully clarify that better.

Comment on lines 550 to 552
Copy link
Member

@picnixz picnixz Nov 16, 2025

Choose a reason for hiding this comment

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

We have 3 blank lines here. I'll let you edit this locally

@ZeroIntensity ZeroIntensity enabled auto-merge (squash) November 16, 2025 19:20
@ZeroIntensity ZeroIntensity added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Nov 16, 2025
@ZeroIntensity ZeroIntensity merged commit be699d6 into python:main Nov 16, 2025
32 checks passed
@ZeroIntensity ZeroIntensity deleted the document-pycfunction-pycmethod branch November 16, 2025 19:25
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Nov 16, 2025
@miss-islington-app
Copy link

Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 16, 2025
pythonGH-141253)

(cherry picked from commit be699d6)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Nov 16, 2025

GH-141637 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Nov 16, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 16, 2025
pythonGH-141253)

(cherry picked from commit be699d6)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Nov 16, 2025

GH-141638 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 16, 2025
ZeroIntensity added a commit that referenced this pull request Nov 16, 2025
…Is (GH-141253) (GH-141637)

gh-141004: Document missing `PyCFunction*` and `PyCMethod*` APIs (GH-141253)
(cherry picked from commit be699d6)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
ZeroIntensity added a commit that referenced this pull request Nov 16, 2025
…Is (GH-141253) (GH-141638)

gh-141004: Document missing `PyCFunction*` and `PyCMethod*` APIs (GH-141253)
(cherry picked from commit be699d6)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants