[docs] [issue15104] abusive language in __name__ description

anatoly techtonik report at bugs.python.org
Tue Jun 19 11:10:37 CEST 2012


anatoly techtonik <techtonik at gmail.com> added the comment:

Now I get it. That's much better. Thanks. =)

After rereading the description with this new info I spot that __main__ is called a module, which is not true, because it is only a module name. It makes sense to enclose it in quotes in title as well.

I'd reword this:
{{{
This module represents the (otherwise anonymous) scope in which the interpreter’s main program executes — commands read either from standard input, from a script file, or from an interactive prompt. It is this environment in which the idiomatic “conditional script” stanza causes a script to run:
}}}

to this:
{{{
This __name__ value represents (otherwise anonymous) scope of the program’s main module in the interpreter. __name__ becomes equal to '__main__' when commands read either from standard input, from a script file, or from an interactive prompt. For example, a common way to add code to module that will only be executable when run as a script is to place it into the following if block:
}}}

Not academic, but practical.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15104>
_______________________________________


More information about the docs mailing list