Re: PEP 489: Multi-phase extension module initialization; version 5
Antoine Pitrou <[email protected]> Mon, 18 May 2015 17:15:07 +0200
| Newsgroups | gmane.comp.python.import |
|---|---|
| Message-ID | <20150518171507.6f711718@fsol> |
On Mon, 18 May 2015 17:07:20 +0200 Petr Viktorin <[email protected]> wrote: > On Mon, May 18, 2015 at 4:51 PM, Antoine Pitrou <[email protected]> wrote: > > > > Hi, > > > > On Mon, 18 May 2015 16:02:37 +0200 > > Petr Viktorin <[email protected]> wrote: > >> > >> I've sent the latest update of PEP 489 to the editors. I am quite happy > >> with how it turned out, and I don't expect too many further changes. > > > > I'm surprised the PEP still mentions PyModule_GetState. Shouldn't it be > > discouraged in favour of custom module object fields? > > No, it's the other way around -- we want to discourage using custom > module subclasses; most modules should just customize the exec phase. Can you explain why? The module state mechanism has turned out to be cumbersome and inefficient, and is the main reason why PEP 3121 conversions of many stdlib modules have been deferred or abandoned. A fast, easy way to access module "state" without defining global variables at the C level is required. Regards Antoine.