[Python-Dev] Python 2.3a1 release -- Dec 31

Samuele Pedroni pedronis@bluewin.ch
Wed, 25 Dec 2002 17:06:43 +0100


From: "Just van Rossum" <just@letterror.com>

> Samuele Pedroni wrote:
>
> > Indeed it seemed that there was consensus to want [__path__
> > manipulations] (messy, hackish or whatever they may seem).
>
> But, as I wrote, it *can't* work with importers in general. It can be
> made to work with specific importers, such as zipimporter, but I don't
> see the point (I'll rant about that in a second ;-).

but such importers would better go in meta_path.

Btw, reading PEP 302 it seems that when dealing with a package,
first *all* importers in sys.meta_path called with

fullname and __path__ of the package.

For symmetry (as long as we keep __path__) I think the import mechanism would
have to look
for a list in __meta__path__ (or maybe just a single value in
__meta_importer__):

if it's absent, thing should work as described above,

if it's empty, sys.meta_path should be ignored,

otherwise it's content should be used instead of sys.meta_path and __path__
should be ignored up to passing it to the meta importer(s).

Basically this would mean that the contents of __path__ should be
interpreted/used only by the meta importer.

regards