Re: PEP 489: Multi-phase extension module initialization; version 5

Antoine Pitrou <[email protected]> Mon, 18 May 2015 17:58:03 +0200
Newsgroups gmane.comp.python.import
Message-ID <20150518175803.03a1e0cf@fsol>
On Mon, 18 May 2015 17:32:13 +0200
Petr Viktorin <[email protected]> wrote:
> 
> > A fast, easy way to access module "state" without defining global
> > variables at the C level is required.
> 
> You can have a custom subclass, or you can use per-module state, or
> put a capsule in the module dict.

The latter two are cumbersome and inefficient. Only custom subclasses
can make things easy and fast at the C level. Which is why I'm
surprised that you seem to be encouraging, or not discouraging, the
"module state" API.

Regards

Antoine.