Skip to content

Conversation

@encukou
Copy link
Member

@encukou encukou commented Nov 6, 2025

When working on PEP-793 docs, I found some backportable clarifications. (Sure, some clarify that the functions are somewhat dangerous with free-threading...)

Also: Turn a mention of types.ModuleType into a link.


📚 Documentation preview 📚: https://cpython-previews--141159.org.readthedocs.build/

@encukou encukou requested a review from ZeroIntensity November 6, 2025 16:57
@encukou encukou added docs Documentation in the Doc dir skip issue needs backport to 3.13 bugs and security fixes labels Nov 6, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Nov 6, 2025
@encukou encukou added the needs backport to 3.14 bugs and security fixes label Nov 6, 2025
Comment on lines +684 to +685
The *functions* array must be statically allocated (or otherwise guaranteed
to outlive 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.

I think it's a little bit confusing to say something must be true, and then immediately contradict it. How about we say something like this?

The *functions* array must outlive the module object. A common way to do
this is to statically allocate it.

Comment on lines +684 to +685
The *functions* array must be statically allocated (or otherwise guaranteed
to outlive the module object).
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think there is a practical alternative unless you're doing something really special, so I would like keep this footnote-ish -- but part of the same sentence to avoid wording like “as a special exception”.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I don't wholly agree, but I won't bother arguing about it.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

LGTM

@encukou encukou merged commit ffd6473 into python:main Nov 7, 2025
32 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Nov 7, 2025
@encukou encukou deleted the capi-ownership-docs branch November 7, 2025 13:17
@miss-islington-app
Copy link

Thanks @encukou 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 7, 2025
…ythonGH-141159)

(cherry picked from commit ffd6473)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Nov 7, 2025

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

@miss-islington-app
Copy link

Sorry, @encukou, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker ffd64737d00277eea1c4721d278a0951168d07ca 3.13

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Nov 7, 2025
encukou added a commit to encukou/cpython that referenced this pull request Nov 7, 2025
…tions (pythonGH-141159)

(cherry picked from commit ffd6473)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Nov 7, 2025

GH-141191 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 7, 2025
@encukou
Copy link
Member Author

encukou commented Nov 7, 2025

Thanks!

Eventually we'll remove the requirement anyway :)

encukou added a commit that referenced this pull request Nov 7, 2025
…tions (GH-141159) (GH-141190)

(cherry picked from commit ffd6473)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
encukou added a commit that referenced this pull request Nov 10, 2025
…tions (GH-141159) (GH-141191)

(cherry picked from commit ffd6473)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
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 issue skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants