Andy C wrote:
>... a .zip file with a __zipmain__.py module at its root?

Why not just an __init__.py, which you would normally execute if you
tried to import/run a directory?

> * Magically looking at the first argument to see if it's a zip file
> seems problematic to me.  I'd rather be explicit with the -z flag.
> Likewise, I'd rather be explicit and call it __zipmain__ rather than
> __main__.

Treating zip files (and only zip files) as a special case equivalent
to uncompressed files seems like a wart; I would prefer not to
special-case zips any more than they already are.

If anything, I would like to see the -m option enhanced so that if it
gets a recognized "collection" file type (including a directory or
zip), it does the right thing.  Whether that actually makes sense, or
defeats the purpose of the -m shortcut, I'm not sure.

[on using __main__ instead of __init__ or __zipmain__]

> __main__.py?  : )  If someone tries does import __main__ from another
> module in the program, won't that result in an infinite loop?

It doesn't today; it does use circular imports, which can be a problem.

> while I think it would be a bad practice to
> import __main__,

I have seen it recommended as the right place to store global
(cross-module) settings.

-jJ
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to