would be nice: import from archive

Alex Martelli aleaxit at yahoo.com
Fri Aug 27 17:28:19 EDT 2004


Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:

> aleaxit at yahoo.com (Alex Martelli) writes:
> > > Here is a python feature that I would like: to be able to import modules
> > > from an archive like the jar files in Java.  Maybe a regular tar file?
> > 
> > Python 2.3 lets you import modules from a zipfile.  The zip format is
> > better than tar when you just need to get one file from it, which is why
> > java's jar files are also basically zipfiles.
> 
> Jar files are -signed- zip files.  Is there some reason to not do that
> for Python?

I know of no reason to forbid support for such "signing", no.  If you
want to offer a patch to zipimport to let it support whatever signing,
encryption, or other devilry appeals to you, this is definitely the
right moment if you hope to see it happen in Python 2.4.

If you mean patching zipimport to _forbid_ importing from any zipfile
whatsoever, including a plain vanilla one, I think it's too late for
THAT for Python 2.4 -- not sure what backwards incompatibilities that
might cause, but it's definitely not the kind of thing you can spring on
the world in a release that's already fast moving towards its
hopefully-last alpha release.  (Adding functionality is one thing,
breaking compatibility with something that a previous release allowed is
quite another...).


Alex



More information about the Python-list mailing list