[Python-Dev] Inconsistent behaviour in import/zipimport hooks

Gustavo Sverzut Barbieri barbieri at gmail.com
Wed Nov 9 22:12:38 CET 2005


On 11/9/05, Guido van Rossum <guido at python.org> wrote:
> On 11/9/05, Osvaldo Santana <osantana at gmail.com> wrote:
> > I've noticed this inconsistency when we stop to use zipimport in our
> > Python For Maemo distribution. We've decided to stop using zipimport
> > because the device (Nokia 770) uses a compressed filesystem.
>
> I won't comment further on the brainstorm that's going on (this is
> becoming a topic for c.l.py) but I think you are misunderstanding the
> point of zipimport. It's not done (usually) for the compression but
> for the index. Finding a name in the zipfile index is much more
> efficient than doing a directory search; and the zip index can be
> cached.

Any way, not loading .pyo if no .pyc or .py is available is a
drawback, specially on unices that have scripts starting with
"#!/usr/bin/python" or "#!/usr/bin/env python" and the system just
have .pyo files, due a bunch of reasons, in this case the small disc
space.


--
Gustavo Sverzut Barbieri
--------------------------------------
Computer Engineer 2001 - UNICAMP
Mobile: +55 (19) 9165 8010
 Phone:  +1 (347) 624 6296 @ sip.stanaphone.com
Jabber: gsbarbieri at jabber.org
  ICQ#: 17249123
   MSN: barbieri at gmail.com
   GPG: 0xB640E1A2 @ wwwkeys.pgp.net


More information about the Python-Dev mailing list