[Import-SIG] PEP 420: Implicit Namespace Packages

Brett Cannon brett at python.org
Fri May 4 18:21:36 CEST 2012

On Fri, May 4, 2012 at 12:00 PM, fwierzbicki at gmail.com <
fwierzbicki at gmail.com> wrote:

> On Fri, May 4, 2012 at 7:34 AM, Barry Warsaw <barry at python.org> wrote:
> > It's also not true even today.  At our PEP 420 sprint we noticed
> importlib
> > does something like this to create new modules:
> >
> >    >>> type(sys)('foo')
> >
> > That module isn't a built-in and doesn't have an __file__.  It also
> > doesn't have an __loader__, but oh well.
> >
> > (BTW, Brett, that's pretty clever. :)
> Too clever for Jython at them moment :) -- which leads me to ask:
> Should I consider this a a feature of the sys module?

No, this is an ability of types.ModuleType (which I don't have access to in
importlib, so I just inlined the call). This works for any module in

> It doesn't look
> too hard to do, and I really want importlib to work when Jython starts
> on Jython3 (I'm hoping to seriously start that this summer - Jython
> 2.7 is progressing well).

 I've actually been meaning to email the various VMs to have them look over
importlib to see if there are any sticking points that are obvious so we
can fix them now instead of waiting until a point release when the first VM
other than CPython tries to use importlib.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/import-sig/attachments/20120504/53f3c195/attachment-0001.html>

More information about the Import-SIG mailing list