[Python-Dev] imputil and modulefinder replacements (original) (raw)

Samuele Pedroni pedroni@inf.ethz.ch
Fri, 5 Oct 2001 20:06:23 +0200


Hi

[Greg Ward]

> One question: should these ZIP-archives filenames be placed in > sys.path or should Python scan for ZIP-archives within the > dirs on sys.path ?

I think the archive file should be listed in sys.path.

the latest jython code base (2.1a3) allow to put jar/zip in the sys.path or reference of the form

jarfile!pkgdir1/pkgdir2

This are used to set meaningful path attrs for the packages and should allow to deal with code that change path pointing to some relative subdir according to some context property.

Note that my experience of this in Java was largely negative, because Java doesn't have a standard way of putting .class files in the filesystem (AFAIK) -- so everything has to be in a .jar file, and those .jar files can be anywhere you please.

I don't get the point :(

So you end up with a mile-long CLASSPATH that's very fragile and forever needing fixing. As long as most Python modules are accessed the ordinary way (files in a directory), then Python won't have a problem. But if somebody makes a Python installation with "stdlib.zip", "distutils.zip", "mxDateTime.zip", etc. etc., then the poor users will be in the same boat as Java users.

The main concerns I have with scanning sys.path directories for ZIP files are performance and transparence. (It ain't necessarily obvious where a particular module will come from if sys.path can be searched in two ways.)

I agree.

regards.