[Python-Dev] Pre-PEP: Redesigning extension modules

Nick Coghlan ncoghlan at gmail.com
Sun Aug 25 08:36:48 CEST 2013

On 25 August 2013 14:12, PJ Eby <pje at telecommunity.com> wrote:
> That is to say, in the pure PEP 302 world, there is no special status
> for "reload" that is different from "load" -- the *only* thing that's
> different is that there is already a module object to use, and there
> is *no guarantee that it's a module object that was initialized by the
> loader now being invoked*.

Yeah, this is an aspect of why I'd like PEP 451 to use create & exec
for the new loader API components. That way, any loader which either
doesn't define the create method, or which returns NotImplemented from
the call (a subtlety needed to make this work for C extensions), can
be used with reload *and* with the -m switch via runpy (currently
runpy demands the ability to get hold of the code object).

> AFAICT both this proposal and the ModuleSpec one are making an invalid
> assumption per PEP 302, and aren't explicitly proposing to change the
> status quo: they just assume things that aren't actually assured by
> the prior specs or implementations.



Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list