[Import-SIG] PEP 489: Redesigning extension module loading; version 4

Nick Coghlan ncoghlan at gmail.com
Fri May 15 08:10:02 CEST 2015


On 15 May 2015 05:04, "Petr Viktorin" <encukou at gmail.com> wrote:
>
> On Thu, May 14, 2015 at 6:45 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> > On 14 May 2015 at 22:38, Petr Viktorin <encukou at gmail.com> 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 :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/import-sig/attachments/20150515/80032c4f/attachment-0001.html>


More information about the Import-SIG mailing list