[Python-Dev] Another approach for the import mechanism

Just van Rossum just@letterror.com
Fri, 6 Dec 2002 12:34:06 +0100


Moore, Paul wrote:

> From: Martin v. L=F6wis [mailto:martin@v.loewis.de]
> > __path__[0] cannot be an object originally, because the
> > package loader inserts a string, always.
>=20
> Thinking some more, I'd dispute that "always". The *current*
> package loader inserts a string, yes. Under Just's patch,
> I think this remains true, as well.

The last patch I posted here inserts zipimporter instances in __path__, j=
ust as
it replaces *.zip sys.path entries with zipimporter instances. Allowing o=
bjects
on sys.path/pkg.__path__ is still the most lo-tech solution, but it seems
there's too much opposition for that, so I'll continue to work on an
iu.py-inspired solution. I hope to post a patch later today. (Since I don=
't have
access to a Windows box I can't test on windows, so any help from your en=
d (or
anyone's) will be greatly appreciated.)

Just