[Python-Dev] PEP 273 - Import from Zip Archives

Gordon McMillan gmcm@hypernet.com
Thu, 28 Feb 2002 10:55:39 -0500

[M.-A. Lemburg]
> > > This would be nice to have, but how do you
> > > bootstrap the importer if it's written in Python ?

The response to "let's revamp C import" is "Oh no,
we need a chance to play with it in Python first."

[Thomas Heller]
> > Have you looked at imputil? It bootstraps itself only
> > from builtin modules (which may be the only mechanism
> > to be in the core).

True when Greg wrote it, but strop is now
depecrated, and not necessarily builtin. It's
still the best route, because strop has no
dependencies, while string does.
> Sure, but for finding imputil itself you still need the
> C import mechanism. Even worse: if Python can't find
> imputil (for some reason), it would be completely
> broken.

If Python can't find the std lib, it's broken. No
change there.
> My only gripe with the existing C implementation is
> that I would like to have more hooks available.

All the more reason to try it in Python first. There's
never been agreement about what hooks should
be available. The import-sig was founded so ihooks
defenders could hash it out with imputil defenders
(the ihooks camp has never said a word).

It's my observation that most import hacks these
days are really namespace hacks anyway (that
is, they do a relatively normal import, and then
alter the way it's exposed so that "replace dots
with slashes and look in the filesystem" no
longer applies).

-- Gordon