A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-July/073935.html below:

[Python-Dev] Add a -z interpreter flag to execute a zip file

[Python-Dev] Add a -z interpreter flag to execute a zip file [Python-Dev] Add a -z interpreter flag to execute a zip fileAndy C andychup at gmail.com
Sat Jul 14 19:39:19 CEST 2007
On 7/13/07, Jim Jewett <jimjjewett at gmail.com> wrote:
> 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.

Just to clarify, my patch already works with uncompressed directory
trees just fine.  It's just a matter of naming, I suppose.

I don't mind calling it -z and using it for directories.  But mainly
that's because no one has proprosed another name. : )  I think we've
agreed that -p is something totally different.

> > 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.

Where?  People use __main__.py now?  That seems bad, because __ names
are reserved, so they should just use main.py, I would think.

Andy
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4