Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Clarify argument/result ownership/validity for PyModule_* functions#141159

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
encukou merged 2 commits intopython:mainfromencukou:capi-ownership-docs
Nov 7, 2025

Conversation

@encukou
Copy link
Member

@encukouencukou commentedNov 6, 2025
edited by github-actionsbot
Loading

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

Also: Turn a mention oftypes.ModuleType into a link.


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

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 somethingmust 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 dothis 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
MemberAuthor

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

@ZeroIntensityZeroIntensity left a comment

Choose a reason for hiding this comment

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

LGTM

@encukouencukou merged commitffd6473 intopython:mainNov 7, 2025
32 checks passed
@github-project-automationgithub-project-automationbot moved this fromTodo toDone inDocs PRsNov 7, 2025
@encukouencukou deleted the capi-ownership-docs branchNovember 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 requestNov 7, 2025
…ythonGH-141159)(cherry picked from commitffd6473)Co-authored-by: Petr Viktorin <encukou@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@bedevere-app
Copy link

GH-141190 is a backport of this pull request to the3.14 branch.

@miss-islington-app
Copy link

Sorry,@encukou, I could not cleanly backport this to3.13 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker ffd64737d00277eea1c4721d278a0951168d07ca 3.13

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelNov 7, 2025
encukou added a commit to encukou/cpython that referenced this pull requestNov 7, 2025
…tions (pythonGH-141159)(cherry picked from commitffd6473)Co-authored-by: Petr Viktorin <encukou@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@bedevere-app
Copy link

GH-141191 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelNov 7, 2025
@encukou
Copy link
MemberAuthor

Thanks!

Eventually we'll remove the requirement anyway :)

encukou added a commit that referenced this pull requestNov 7, 2025
…tions (GH-141159) (GH-141190)(cherry picked from commitffd6473)Co-authored-by: Petr Viktorin <encukou@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ZeroIntensityZeroIntensityZeroIntensity approved these changes

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

Assignees

@encukouencukou

Labels

docsDocumentation in the Doc dirskip issueskip news

Projects

Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@encukou@ZeroIntensity

[8]ページ先頭

©2009-2025 Movatter.jp