Re: PEP 489: Redesigning extension module loading; version 4
Nick Coghlan <[email protected]> Fri, 15 May 2015 16:10:02 +1000
| Newsgroups | gmane.comp.python.import |
|---|---|
| Message-ID | <CADiSq7cMtfhiXXmYRSOfK+kfozSkfbzCt-_okMsvMRL_TkTPZQ@mail.gmail.com> |
On 15 May 2015 05:04, "Petr Viktorin" <[email protected]> wrote: > > On Thu, May 14, 2015 at 6:45 PM, Nick Coghlan <[email protected]> wrote: > > On 14 May 2015 at 22:38, Petr Viktorin <[email protected]> wrote: > >> Allowing PyInit to optionally return PyModuleDef is a bit of a hack, > >> but it keeps the details isolated between the module and the import > >> machinery. > >> PyModuleDef is a PyObject, so the PyInit signature matches. Just the > >> PyInit name is a bit misleading :( > > > > Agreed it makes the name of PyInit_* a bit misleading, but also agreed > > that it sounds like a good trick for making this work in a way that > > can handle _PyImport_inittab appropriately. > > > > In terms of documenting it in a way that lets the hook name still make > > sense, perhaps we can refer to returning PyModuleDef as "multi-phase > > initialisation"? That is: > > > > - initialise the module definition > > - create the module object > > - execute the module body > > Yes! That'll even make a much better name for the PEP; currently it > reads like "yet another change". > (I hope I can rename a PEP once submitted?) Yes, renaming is fine. That's one of the advantages of using PEP numbers in their permanent URLs, rather than their names. Cheers, Nick. P.S. I think this change makes this PEP another fine example of why reference implementations are such an important part of the process - they usually uncover issues and implications that *nobody* had thought of yet :) _______________________________________________ Import-SIG mailing list [email protected] https://mail.python.org/mailman/listinfo/import-sig