summaryrefslogtreecommitdiffstats
path: root/Doc/api
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-08-23 18:57:25 (GMT)
committerFred Drake <fdrake@acm.org>1999-08-23 18:57:25 (GMT)
commitc924b8d976ae00e54c097b9996f04a0c77f50c9a (patch)
tree84970bd906b434c01f3f1a62903f6b5e680520c8 /Doc/api
parentf6969fae012bd64ad66eb37e5065d45a37c43f02 (diff)
downloadcpython-c924b8d976ae00e54c097b9996f04a0c77f50c9a.zip
cpython-c924b8d976ae00e54c097b9996f04a0c77f50c9a.tar.gz
cpython-c924b8d976ae00e54c097b9996f04a0c77f50c9a.tar.bz2
Clarified start parameter to Py_CompileString, documented
Py_eval_input, Py_file_input, and Py_single_input. Problems reported by Aaron Brancotti <aaron@icona.it>.
Diffstat (limited to 'Doc/api')
-rw-r--r--Doc/api/api.tex29
1 files changed, 24 insertions, 5 deletions
diff --git a/Doc/api/api.tex b/Doc/api/api.tex
index eaec1f2..3f6e7d6 100644
--- a/Doc/api/api.tex
+++ b/Doc/api/api.tex
@@ -618,13 +618,32 @@ more detailed way with the interpreter.
int start}
Parse and compile the Python source code in \var{str}, returning the
resulting code object. The start token is given by \var{start};
- this can be used to constrain the code which can be compiled. The
- filename specified by \var{filename} is used to construct the code
- object and may appear in tracebacks or \exception{SyntaxError}
- exception messages. This returns \NULL{} if the code cannot be
- parsed or compiled.
+ this can be used to constrain the code which can be compiled and should
+ be \constant{Py_eval_input}, \constant{Py_file_input}, or
+ \constant{Py_single_input}. The filename specified by
+ \var{filename} is used to construct the code object and may appear
+ in tracebacks or \exception{SyntaxError} exception messages. This
+ returns \NULL{} if the code cannot be parsed or compiled.
\end{cfuncdesc}
+\begin{cvardesc}{int}{Py_eval_input}
+ The start symbol from the Python grammar for isolated expressions;
+ for use with \cfunction{Py_CompileString()}.
+\end{cvardesc}
+
+\begin{cvardesc}{int}{Py_file_input}
+ The start symbol from the Python grammar for sequences of statements
+ as read from a file or other source; for use with
+ \cfunction{Py_CompileString()}. This is the symbol to use when
+ compiling arbitrarily long Python source code.
+\end{cvardesc}
+
+\begin{cvardesc}{int}{Py_single_input}
+ The start symbol from the Python grammar for a single statement; for
+ use with \cfunction{Py_CompileString()}. This is the symbol used
+ for the interactive interpreter loop.
+\end{cvardesc}
+
\chapter{Reference Counting \label{countingRefs}}