-
Notifications
You must be signed in to change notification settings - Fork 834
convert module initialization to use multi-phase-init #5142
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
base: main
Are you sure you want to change the base?
Conversation
Note to self: this might need to be opt-out (for a few versions) and be mentioned in the migration guide. |
I like this very much! Is this compatible with how we are currently putting pyclass' type objects in statics? We should figure out a way to store them in module state if possible. |
I think it's sorta fine to leave the type objects in statics for now given we don't support subinterpreters, but yes:
|
I suppose eventually we'll want to allow users to have their own module state as well for their statics :-/ |
This will also put the nail in the coffin for #1444. I'm fine with that personally, but it'll be disappointing for quite a lot of people. Maybe we should start thinking about other ways to address that use case. |
Part of #2274, inspired by all of #2245, #4081, and #4162
This converts the module initialization itself to use module slots and multi-phase init APIs. Module state is deliberately not covered here and left for follow ups. I also don't change anything related to subinterpreter checking, that is also left for a follow up.