On Wed, Feb 8, 2012 at 11:15, Brett Cannon <br...@python.org> wrote:

>
>
> On Tue, Feb 7, 2012 at 22:47, Nick Coghlan <ncogh...@gmail.com> wrote
>
> [SNIP]
>
>
>> The fact that we have an undocumented PEP 302 based reimplementation
>> of imports squirrelled away in pkgutil to make pkgutil and runpy work
>> is sheer insanity (replacing *that* with importlib might actually be a
>> good first step towards full integration).
>>
>
> It easily goes beyond runpy. You could ditch much of imp's C code (e.g.
> load_module()), you could write py_compile and compileall using importlib,
> you could rewrite zipimport, etc. Anything that touches import could be
> refactored to (a) use just Python code, and (b) reshare code so as to not
> re-invent the wheel constantly.
>

And taking it even farther, all of the blackbox aspects of import go away.
For instance, the implicit, hidden importers for built-in modules, frozen
modules, extensions, and source could actually be set on sys.path_hooks.
The Meta path importer that handles sys.path could actually exist on
sys.meta_path.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to