Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libcode.tex @ 9963:0d2791c7206d legacy-trunk
Don't say that the module defines the "following functions" and then
only describe one; say "following function" instead!
Merge the two one-sentence paragraphs into a single paragraph, so it
doesn't look too stupid.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Wed, 27 Jan 1999 15:48:23 +0000 |
| parents | acfffe14628e |
| children | e82e82b3b9ad |
| rev | line source |
|---|---|
| 8918 | 1 \section{\module{code} --- |
| 2 Code object services.} | |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
3 \declaremodule{standard}{code} |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
4 |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
5 \modulesynopsis{Code object services.} |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
6 |
|
5842
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
7 |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 The \code{code} module defines operations pertaining to Python code |
|
9963
0d2791c7206d
Don't say that the module defines the "following functions" and then
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
9 objects. It defines the following function: |
|
5842
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
11 |
|
6960
319a51c381ce
Nit adjustments to remove warnings when processed with partparse.py.
Fred Drake <fdrake@acm.org>
parents:
6896
diff
changeset
|
12 \begin{funcdesc}{compile_command}{source, \optional{filename\optional{, symbol}}} |
|
5842
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
13 This function is useful for programs that want to emulate Python's |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
14 interpreter main loop (a.k.a. the read-eval-print loop). The tricky |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
15 part is to determine when the user has entered an incomplete command |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
16 that can be completed by entering more text (as opposed to a complete |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
17 command or a syntax error). This function \emph{almost} always makes |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
18 the same decision as the real interpreter main loop. |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
19 |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
20 Arguments: \var{source} is the source string; \var{filename} is the |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
21 optional filename from which source was read, defaulting to |
|
9963
0d2791c7206d
Don't say that the module defines the "following functions" and then
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
22 \code{'<input>'}; and \var{symbol} is the optional grammar start |
|
0d2791c7206d
Don't say that the module defines the "following functions" and then
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
23 symbol, which should be either \code{'single'} (the default) or |
|
0d2791c7206d
Don't say that the module defines the "following functions" and then
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
24 \code{'eval'}. |
|
5842
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
25 |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
26 Return a code object (the same as \code{compile(\var{source}, |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
27 \var{filename}, \var{symbol})}) if the command is complete and valid; |
|
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
28 return \code{None} if the command is incomplete; raise |
|
9963
0d2791c7206d
Don't say that the module defines the "following functions" and then
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
29 \exception{SyntaxError} if the command is a syntax error. |
|
5842
35b14d78c61d
added code.py; codehack.py is obsolete
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
30 \end{funcdesc} |
