Of course the major potentially non obvious caveats are that a lot of python 
code doesn't use the API to load data from the importer path, instead using 
__file__ and assuming everything is one, and that sometimes (shared libraries) 
the system can't load it unless its a real file.

Daniel Holth

On Sep 15, 2012, at 11:44 PM, Chris Jerdonek <chris.jerdo...@gmail.com> wrote:

> On Sat, Sep 15, 2012 at 8:19 PM, Daniel Holth <dho...@gmail.com> wrote:
>> I'd like to take this moment to note how awesome importing from
>> zipfile is. Did you know you can execute a zip file with Python, and
>> if it has a __main__.py in the root it will be executed, with the
>> zipfile's contents on the PYTHONPATH?
> 
> I've known this, but can you say a little about the caveats (e.g. why
> you wouldn't always want to store your packages as zip files)?  For
> example, IIRC you can't really use __file__ from within such modules.
> 
> --Chris
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to