[Python-Dev] zipimport, round 3 (or would that be that 37?)

Just van Rossum just@letterror.com
Mon, 9 Dec 2002 19:03:59 +0100


Samuele Pedroni wrote:

> Java class loaders,
> 
> http://java.sun.com/j2se/1.4.1/docs/api/java/lang/ClassLoader.html
> 
> from them one can retrieve java classes or data resources.
> 
> E.g. when Jython is embedded, the embedding enviroment can have setup
> classloaders to access Jython code and other bundled data
> ( getResource, getResourceAsStream).
> And our users would like to bundle and access Python code from there.
> 
> They are purely runtime object, and an abstraction over the filesystem, zip
> files or some remote code repository of whatever...

With my current patch you could just add a "special" string to sys.path, and
associate an importer object with it. However, this sounds like a job for iu's
metapath (which I also intend to implement, if only to show it's possible). Very
much simplified, this allows you to add inport hooks that *don't* correspond to
sys.path items.

I'm almost done with my note about this stuff; will explain in more detail
there.

Just