Re: PEP 420: Implicit Namespace Packages
| Newsgroups | gmane.comp.python.import |
|---|---|
| Message-ID | <CADrh4zK3CYVZ3PvbxpoORWXu+FxopoB+KAKev8OPfjfJV95oJA@mail.gmail.com> |
On Fri, May 4, 2012 at 9:21 AM, Brett Cannon <[email protected]> wrote: >> 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 > CPython. Ah of course, and our ModuleType works just fine for this. The Jython sys module is fake sadly. Perhaps 3.x will be the time to finally make it a real module... it's been a fake module with a comment at the top to make it a real module for longer than I've been involved. BTW any real module works for us, for example: >>> type(os)('foo') <module 'foo' (built-in)> -Frank