Commit 625d70a7 authored by Fred Drake's avatar Fred Drake

Fix references to the built-in compile() that don't include the

filename parameter.  Noted by Randall Hopper <aa8vb@yahoo.com>.
parent 35784dff
...@@ -109,18 +109,18 @@ to create the \code{'eval'} and \code{'exec'} forms. ...@@ -109,18 +109,18 @@ to create the \code{'eval'} and \code{'exec'} forms.
\begin{funcdesc}{expr}{source} \begin{funcdesc}{expr}{source}
The \function{expr()} function parses the parameter \var{source} The \function{expr()} function parses the parameter \var{source}
as if it were an input to \samp{compile(\var{source}, 'eval')}. If as if it were an input to \samp{compile(\var{source}, 'file.py',
the parse succeeds, an AST object is created to hold the internal 'eval')}. If the parse succeeds, an AST object is created to hold the
parse tree representation, otherwise an appropriate exception is internal parse tree representation, otherwise an appropriate exception
thrown. is thrown.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{suite}{source} \begin{funcdesc}{suite}{source}
The \function{suite()} function parses the parameter \var{source} The \function{suite()} function parses the parameter \var{source}
as if it were an input to \samp{compile(\var{source}, 'exec')}. If as if it were an input to \samp{compile(\var{source}, 'file.py',
the parse succeeds, an AST object is created to hold the internal 'exec')}. If the parse succeeds, an AST object is created to hold the
parse tree representation, otherwise an appropriate exception is internal parse tree representation, otherwise an appropriate exception
thrown. is thrown.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{sequence2ast}{sequence} \begin{funcdesc}{sequence2ast}{sequence}
...@@ -323,7 +323,7 @@ this purpose, using the \module{parser} module to produce an ...@@ -323,7 +323,7 @@ this purpose, using the \module{parser} module to produce an
intermediate data structure is equivalent to the code intermediate data structure is equivalent to the code
\begin{verbatim} \begin{verbatim}
>>> code = compile('a + 5', 'eval') >>> code = compile('a + 5', 'file.py', 'eval')
>>> a = 5 >>> a = 5
>>> eval(code) >>> eval(code)
10 10
...@@ -336,7 +336,7 @@ as an AST object: ...@@ -336,7 +336,7 @@ as an AST object:
\begin{verbatim} \begin{verbatim}
>>> import parser >>> import parser
>>> ast = parser.expr('a + 5') >>> ast = parser.expr('a + 5')
>>> code = ast.compile() >>> code = ast.compile('file.py')
>>> a = 5 >>> a = 5
>>> eval(code) >>> eval(code)
10 10
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment