diff options
author | Fred Drake <fdrake@acm.org> | 2000-05-09 17:10:23 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-05-09 17:10:23 (GMT) |
commit | 625d70a7a6fed4193380cb410795e54a6069f3bf (patch) | |
tree | 1c7d1b2438de3f53f91c01cc8fd2133a1831036d /Doc | |
parent | 35784dff6a81fd47aef3ab58316a254d6e9f330e (diff) | |
download | cpython-625d70a7a6fed4193380cb410795e54a6069f3bf.zip cpython-625d70a7a6fed4193380cb410795e54a6069f3bf.tar.gz cpython-625d70a7a6fed4193380cb410795e54a6069f3bf.tar.bz2 |
Fix references to the built-in compile() that don't include the
filename parameter. Noted by Randall Hopper <aa8vb@yahoo.com>.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libparser.tex | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Doc/lib/libparser.tex b/Doc/lib/libparser.tex index ce84513..c478b93 100644 --- a/Doc/lib/libparser.tex +++ b/Doc/lib/libparser.tex @@ -109,18 +109,18 @@ to create the \code{'eval'} and \code{'exec'} forms. \begin{funcdesc}{expr}{source} The \function{expr()} function parses the parameter \var{source} -as if it were an input to \samp{compile(\var{source}, 'eval')}. If -the parse succeeds, an AST object is created to hold the internal -parse tree representation, otherwise an appropriate exception is -thrown. +as if it were an input to \samp{compile(\var{source}, 'file.py', +'eval')}. If the parse succeeds, an AST object is created to hold the +internal parse tree representation, otherwise an appropriate exception +is thrown. \end{funcdesc} \begin{funcdesc}{suite}{source} The \function{suite()} function parses the parameter \var{source} -as if it were an input to \samp{compile(\var{source}, 'exec')}. If -the parse succeeds, an AST object is created to hold the internal -parse tree representation, otherwise an appropriate exception is -thrown. +as if it were an input to \samp{compile(\var{source}, 'file.py', +'exec')}. If the parse succeeds, an AST object is created to hold the +internal parse tree representation, otherwise an appropriate exception +is thrown. \end{funcdesc} \begin{funcdesc}{sequence2ast}{sequence} @@ -323,7 +323,7 @@ this purpose, using the \module{parser} module to produce an intermediate data structure is equivalent to the code \begin{verbatim} ->>> code = compile('a + 5', 'eval') +>>> code = compile('a + 5', 'file.py', 'eval') >>> a = 5 >>> eval(code) 10 @@ -336,7 +336,7 @@ as an AST object: \begin{verbatim} >>> import parser >>> ast = parser.expr('a + 5') ->>> code = ast.compile() +>>> code = ast.compile('file.py') >>> a = 5 >>> eval(code) 10 |