[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

Thomas Wouters report at bugs.python.org
Sun Mar 4 22:35:21 EST 2018


Thomas Wouters <thomas at python.org> added the comment:

Re: Petr: we can't expect extension module authors to retroactively fix released modules. We can't even expect everyone to fix this for future releases; moving away from globals (which may not be specific to the Python extension module) may be a lot of effort. Just look at how much work it's taking to move CPython itself to stop using globals in so many places. And while it may be necessary for sub-interpreters (which is only the case for global state that's Python objects), many people just don't care about sub-interpreters.

Re: Stefan: the init function pointer isn't known until much later in the current process, and calculated from the module name. There is not currently a way to import a module with a different init function pointer. I don't think this warrants that much of a rewrite.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32973>
_______________________________________


More information about the Python-bugs-list mailing list