[Import-SIG] PEP 489: Multi-phase extension module initialization; version 5

Antoine Pitrou solipsis at pitrou.net
Mon May 18 19:17:21 CEST 2015

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.



More information about the Import-SIG mailing list