Message337089
PyModule_GetState() gives you *per-module* state, not per-interpreter state.
Module objects are shared across subinterpreters, unless you use multi-phase initialization.
> PyModule_GetState() requires having the module object that corresponds
> to the given interpreter state. I'm not sure how a C extension module
> is supposed to get its own module object corresponding to the current
> interpreter state, without getting it from the caller in some way.
This is the problem described in PEP 573: you don't always have access to your own module object. That keeps some more complex modules from switching to multi-phase init.
Unless this issue can wait for when PEP 580, PEP 573, and possibly some fallout of unknown unknowns are solved, let's add PyInterpreterState_GetDict for now. |
|
Date |
User |
Action |
Args |
2019-03-04 10:42:02 | petr.viktorin | set | recipients:
+ petr.viktorin, arigo, ncoghlan, eric.snow |
2019-03-04 10:42:02 | petr.viktorin | set | messageid: <1551696122.02.0.0501047351008.issue36124@roundup.psfhosted.org> |
2019-03-04 10:42:02 | petr.viktorin | link | issue36124 messages |
2019-03-04 10:42:01 | petr.viktorin | create | |
|