The Wayback Machine - https://web.archive.org/web/20230226134442/https://github.com/python/cpython/pull/101477
Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-101476: Add _PyType_GetModuleState #101477

Merged
merged 11 commits into from Feb 23, 2023

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Jan 31, 2023

For fast module state access from heap type methods.

For fast module state access from heap type methods.
@erlend-aasland
Copy link
Contributor Author

I'm not sure we should add a NEWS entry for this; this is an internal C API.

Copy link
Contributor

@kumaraditya303 kumaraditya303 left a comment

Choose a reason for hiding this comment

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

Nice!

@erlend-aasland
Copy link
Contributor Author

Thanks for the review, Kumar!

Even though I also got thumbs-up from Guido og Steve on Discourse, I'd like to wait for at least one other core dev approval before landing this PR.

@encukou
Copy link
Member

encukou commented Feb 2, 2023

+1 from me, could you just add a comment to clarify the intent, e.g. /* Like PyType_GetModuleState, but skips verification that type is a heap type with an associated module */

@erlend-aasland
Copy link
Contributor Author

+1 from me, could you just add a comment to clarify the intent, e.g. /* Like PyType_GetModuleState, but skips verification that type is a heap type with an associated module */

Thanks for the review, Petr. I'll add the comment right away.

encukou
encukou approved these changes Feb 3, 2023
@erlend-aasland erlend-aasland changed the title gh-101476: Add _PyType_GetModuleState gh-101476: Add _PyType_GET_MODULE_STATE Feb 6, 2023
gpshead
gpshead approved these changes Feb 7, 2023
@erlend-aasland erlend-aasland added the 🤖 automerge PR will be merged once it's been approved and all CI passed label Feb 23, 2023
@erlend-aasland erlend-aasland changed the title gh-101476: Add _PyType_GET_MODULE_STATE gh-101476: Add _PyType_GetModuleState Feb 23, 2023
@miss-islington
Copy link
Contributor

Status check is done, and it's a success .

@miss-islington miss-islington merged commit ccd98a3 into python:main Feb 23, 2023
15 checks passed
@erlend-aasland erlend-aasland deleted the pytype-getmodulestate branch February 23, 2023 21:44
@erlend-aasland
Copy link
Contributor Author

Thanks for the reviews, everyone! I'm applying this across the core extension modules. See #102188.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 automerge PR will be merged once it's been approved and all CI passed skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add internal API for fast module access from heap type methods
6 participants