Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

gh-101476: Use _PyType_GetModuleState where applicable #102188

Merged

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Feb 23, 2023

@erlend-aasland
Copy link
Contributor Author

I consider this a trivial and non-controversial PR; I intend to merge it as soon as the CI is green. If this turns out to be bad judgement from my side, I'm happy to revert it.

@corona10
Copy link
Member

corona10 commented Feb 24, 2023

If this turns out to be bad judgement from my side, I'm happy to revert it.

I remember that there were some kinds of discussions to use public API as possible.
I will let you know once I find it.

cc @ericsnowcurrently

@corona10
Copy link
Member

Might be one piece of discussion I remember: #90699 (comment)

@ericsnowcurrently
Copy link
Member

At least with _xxsubinterpreters, I purposefully did not use any internal API. Ideally, non-builtin extensions would avoid internal API, generally.

@erlend-aasland
Copy link
Contributor Author

@ericsnowcurrently, @corona10: As the PR title says, I've only applied this where applicable. This implies extension modules that define Py_BUILD_CORE_BUILTIN 1. For extension modules without this define, no change has been made.

@erlend-aasland
Copy link
Contributor Author

I've reverted the change in _testmultiphase.

@ericsnowcurrently
Copy link
Member

BTW, thanks for working on this, @erlend-aasland!

@erlend-aasland
Copy link
Contributor Author

Thanks for comments and reviews, everyone!

@erlend-aasland erlend-aasland merged commit 568fc0d into python:main Feb 24, 2023
@erlend-aasland erlend-aasland deleted the apply-faster-getmodulestate branch February 24, 2023 20:16
JelleZijlstra pushed a commit to JelleZijlstra/cpython that referenced this pull request Sep 10, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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