[Import-SIG] PEP 489: Multi-phase extension module initialization; version 5
encukou at gmail.com
Mon May 18 19:35:57 CEST 2015
On Mon, May 18, 2015 at 7:17 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Mon, 18 May 2015 19:06:53 +0200
> Petr Viktorin <encukou at gmail.com> wrote:
>> > The main problem is the PyState_FindModule() function. It's not
>> > terribly efficient, and most of all you have to check its return value
>> > for NULL.
>> Ah, but that one is orthogonal to per-module state. The
>> PyState_FindModule is concerned with finding "the" module
>> corresponding to a given PyModuleDef in a given interpreter.
>> The problem it attempts to solve is that the module can't easily be
>> passed around to all the places that need it. You'd actually have the
>> exact same problem with a custom subclass -- it's finding the module
>> instance that's the problem, not getting data from it.
> That's a fair point. But it means the PEP won't help those stdlib
> modules which haven't been converted to PEP 3121, then.
Correct. This is not the PEP you're looking for.
Originally we did want to solve this problem, and I guess wording that
suggests it's solved might still be around. Is that the case? Should I
clarify that the problem is not yet solved?
As the author, it's easy for me to lose track of the big picture.
More information about the Import-SIG