[Python-Dev] New and Improved Import Hooks

Just van Rossum just@letterror.com
Tue, 3 Dec 2002 18:10:09 +0100


Moore, Paul wrote:

> Perhaps you could refactor your implementation so that the
> cache isn't just for zipfiles? (I can easily imagine other
> extensions that would benefit - tarfiles, metakit databases,
> imports over the web, ...)

The directory listing is the hardest part and can't be general; caching is as
simple as using a dict. I think it's the responsibility of the import hook.

Btw. I could provide a zip import hook that's not specific to one archive, but
rather searches sys.path for zip files. I'll play with that.

Just