mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
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>.
This commit is contained in:
parent
f6969fae01
commit
c924b8d976
1 changed files with 24 additions and 5 deletions
|
|
@ -618,13 +618,32 @@ more detailed way with the interpreter.
|
||||||
int start}
|
int start}
|
||||||
Parse and compile the Python source code in \var{str}, returning the
|
Parse and compile the Python source code in \var{str}, returning the
|
||||||
resulting code object. The start token is given by \var{start};
|
resulting code object. The start token is given by \var{start};
|
||||||
this can be used to constrain the code which can be compiled. The
|
this can be used to constrain the code which can be compiled and should
|
||||||
filename specified by \var{filename} is used to construct the code
|
be \constant{Py_eval_input}, \constant{Py_file_input}, or
|
||||||
object and may appear in tracebacks or \exception{SyntaxError}
|
\constant{Py_single_input}. The filename specified by
|
||||||
exception messages. This returns \NULL{} if the code cannot be
|
\var{filename} is used to construct the code object and may appear
|
||||||
parsed or compiled.
|
in tracebacks or \exception{SyntaxError} exception messages. This
|
||||||
|
returns \NULL{} if the code cannot be parsed or compiled.
|
||||||
\end{cfuncdesc}
|
\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}}
|
\chapter{Reference Counting \label{countingRefs}}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue