[Python-ideas] Just __main__

anatoly techtonik techtonik at gmail.com
Tue Jun 19 09:01:25 CEST 2012


On Mon, Jun 18, 2012 at 7:57 PM, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> Ethan Furman writes:
>  > anatoly techtonik wrote:
>  > > How about global __main__ as a boolean?
>
> -1
>
> Saves typing, yes, but otherwise there's no point.  It would need just
> as much explanation, for one thing.

It would be more convincing to have a solid counter argument for -1,
or else I am inclined to count 'no point' arguments as -0.

>  > you would have:
>  >
>  >    if __main__:
>  >      ...
>
> Would it be writable?

The same way as __name__. Yes.



More information about the Python-ideas mailing list