Re: PEP 489: Redesigning extension module loading
Antoine Pitrou <[email protected]> Thu, 19 Mar 2015 15:17:55 +0100
| Newsgroups | gmane.comp.python.import |
|---|---|
| Message-ID | <20150319151755.2650243b@fsol> |
On Thu, 19 Mar 2015 14:37:36 +0100 Petr Viktorin <[email protected]> wrote: > On 03/19/2015 11:31 AM, Stefan Behnel wrote: > > Hi Petr, > > > > thanks for working on this. I added my comments inline. > > Thanks for your comments, they're a nice reality check. > I'm feeling a bit like I and Nick misunderstood Cython requirements > somewhat, and concentrated on unimportant points (loading into > pre-created modules) while ignoring important ones (fast access to > module state). Fast access is not only important for Cython, but for various stdlib modules as well (e.g. the _decimal module). By the way, another nice thing would be for access to always succeed; that simplifies extension module code quite a bit. > One of the PEP's stated goals is that the behavior of extension modules > should be be closer to Python modules. But if the solution (Exec-only > modules) does't work for Cython, then the goal is pretty much > irrelevant. I believe PyCapsule is the cleanest way of putting C state > onto arbitrary objects, and by this time I can say it's not working. Note that while *behaviour* may get closer to Python modules, implementation doesn't have to. For example, I don't think it's a problem if an extension module object has to be of a specific type; supporting duck-typing isn't important here. Regards Antoine.