Message163149
| Author |
techtonik |
| Recipients |
docs@python, hynek, loewis, techtonik |
| Date |
2012年06月19日.09:10:33 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1340097037.02.0.578938698853.issue15104@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年06月19日 09:10:37 | techtonik | set | recipients:
+ techtonik, loewis, docs@python, hynek |
| 2012年06月19日 09:10:37 | techtonik | set | messageid: <1340097037.02.0.578938698853.issue15104@psf.upfronthosting.co.za> |
| 2012年06月19日 09:10:36 | techtonik | link | issue15104 messages |
| 2012年06月19日 09:10:33 | techtonik | create |
|