Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libmain.tex @ 25838:8540887bcec6 2.2
Backport of 2.183:
Fix memory leak in add_subclass() found by NealN with valgrind.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 18 Oct 2002 13:42:21 +0000 |
| parents | 79bf6b38b7d5 |
| children |
| rev | line source |
|---|---|
| 8918 | 1 \section{\module{__main__} --- |
|
14035
79bf6b38b7d5
A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
2 Top-level script environment} |
|
79bf6b38b7d5
A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
3 |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
4 \declaremodule[main]{builtin}{__main__} |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
5 \modulesynopsis{The environment where the top-level script is run.} |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
6 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
7 This module represents the (otherwise anonymous) scope in which the |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 interpreter's main program executes --- commands read either from |
|
14035
79bf6b38b7d5
A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
9 standard input, from a script file, or from an interactive prompt. It |
|
79bf6b38b7d5
A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
10 is this environment in which the idiomatic ``conditional script'' |
|
79bf6b38b7d5
A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
11 stanza causes a script to run: |
|
79bf6b38b7d5
A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
12 |
|
79bf6b38b7d5
A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
13 \begin{verbatim} |
|
79bf6b38b7d5
A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
14 if __name__ == "__main__": |
|
79bf6b38b7d5
A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
15 main() |
|
79bf6b38b7d5
A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
16 \end{verbatim} |
