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

Finn Bock bckfnn@worldonline.dk
Thu, 26 Dec 2002 11:19:45 +0100


[Samuele]

>>further this change is backward incompatible with what is allowed by
>>Jython 2.1,
>>
>>it was considered a feature to be able to put
>>
>>path/to/a.zip/python
>>
>>in sys.path, so that the a.b package would be looked up under
>>
>>path/to/a.zip/python/a/b.

[Just]

> PEP 273 doesn't document it as such; it only says it's needed for
> package imports. Also, to be honest, my implementation had some issues
> with that usage: it would look for the plain .zip archive in
> sys.path_importer_cache, which would obviously not be found, causing the
> zip file index to be read again for every package directory. The only
> solution I thought of that could solve that is for the zipimporter
> object to *add* entries to sys.path_importer_cache itself, and I found
> it bad enough already that it _read_ from the cache itself in the
> previous version. It's a messy feature :-(.
> 
> I personally don't care about this feature; it's easy enough to package
> the archive so that it's not needed.

That may be true for CPython but it isn't for jython where the toplevel 
namespace in a zip file is taken already for java classes. By far the 
most natural way to package a jython/java application would be to put 
the jython modules in the same .zip (or .jar) file as the rest of the 
java application and that is best achieved by putting the python modules 
under a seperate directory in the zip file.

So Jython cares about this feature. So mush that we may have to be 
incompatible on this point with CPython.

regards,
finn