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

gh-105020: Share tp_bases and tp_mro Between Interpreters For All Static Builtin Types#105115

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

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrentlyericsnowcurrently commentedMay 30, 2023
edited by bedevere-bot
Loading

Ingh-103912 we added tp_bases and tp_mro to eachPyInterpreterState.types.builtins entry. However, doing so ignored the fact that bothPyTypeObject fields are public API, and not documented as internal (as opposed to tp_subclasses). We address that here by reverting back to shared objects, making them immortal in the process.

Copy link
Member

@gpsheadgpshead left a comment

Choose a reason for hiding this comment

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

Do we have a meaningful place to put a regression test to assert that tp_bases and tp_mro are never NULL in the situations user code was encountering that in 3.12beta1?

@@ -49,8 +49,6 @@ typedef struct {
// XXX tp_dict, tp_bases, and tp_mro can probably be statically
Copy link
Member

Choose a reason for hiding this comment

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

should this comment (added by the original PR) be updated now that bases and mro don't exist here?

ericsnowcurrently and erlend-aasland reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

fixed

@ericsnowcurrently
Copy link
MemberAuthor

Do we have a meaningful place to put a regression test to assert that tp_bases and tp_mro are never NULL in the situations user code was encountering that in 3.12beta1?

I'll add a test intest_capi.

@ericsnowcurrently
Copy link
MemberAuthor

I've added a test. Thanks for the suggestion.

Copy link
Member

@gpsheadgpshead left a comment

Choose a reason for hiding this comment

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

This looks good to me.

I do wonder if anything is going to be tripped up by thetp_dict as well, but that seems like a separate category of change given I believe it could've been NULL in the past - if it comes up it can be addressed separately.

ericsnowcurrently reacted with thumbs up emoji
@gpshead
Copy link
Member

you might want a NEWS entry fwiw... as people do read the changelog between beta1 and beta2.

ericsnowcurrently reacted with thumbs up emoji

@ericsnowcurrentlyericsnowcurrentlyenabled auto-merge (squash)May 30, 2023 23:46
@ericsnowcurrentlyericsnowcurrently merged commit7be667d intopython:mainMay 31, 2023
@miss-islington
Copy link
Contributor

Thanks@ericsnowcurrently for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry@ericsnowcurrently, I had trouble checking out the3.12 backport branch.
Please retry by removing and re-adding the "needs backport to 3.12" label.
Alternatively, you can backport usingcherry_picker on the command line.
cherry_picker 7be667dfafa2465df6342d72dca9c1f82dd830d0 3.12

@miss-islington
Copy link
Contributor

Thanks@ericsnowcurrently for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 31, 2023
…ll Static Builtin Types (pythongh-105115)Inpythongh-103912 we added tp_bases and tp_mro to each PyInterpreterState.types.builtins entry.  However, doing so ignored the fact that both PyTypeObject fields are public API, and not documented as internal (as opposed to tp_subclasses).  We address that here by reverting back to shared objects, making them immortal in the process.(cherry picked from commit7be667d)Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
@bedevere-bot
Copy link

GH-105124 is a backport of this pull request to the3.12 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.12only security fixes labelMay 31, 2023
@ericsnowcurrentlyericsnowcurrently deleted the fix-tp-bases branchMay 31, 2023 00:23
ericsnowcurrently pushed a commit that referenced this pull requestJun 1, 2023
…All Static Builtin Types (gh-105115) (gh-105124)Ingh-103912 we added tp_bases and tp_mro to each PyInterpreterState.types.builtins entry.  However, doing so ignored the fact that both PyTypeObject fields are public API, and not documented as internal (as opposed to tp_subclasses).  We address that here by reverting back to shared objects, making them immortal in the process.(cherry picked from commit7be667d)Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gpsheadgpsheadgpshead approved these changes

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaou

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@Yhg1sYhg1sAwaiting requested review from Yhg1s

Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@ericsnowcurrently@gpshead@miss-islington@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp