diff options
| author | Benjamin Peterson <benjamin@python.org> | 2008-11-08 16:55:33 +0000 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2008-11-08 16:55:33 +0000 |
| commit | d923f987d1b2fc6b33010708aa1a93eb39433a21 (patch) | |
| tree | d63ca16931bd9b3fb5d30c838a140c3f8d912d73 /Doc/library/ast.rst | |
| parent | 0d2fa3aea5cac33b84baa730f421594af92c0dc1 (diff) | |
| download | cpython-git-d923f987d1b2fc6b33010708aa1a93eb39433a21.tar.gz | |
a few compile() and ast doc improvements
Diffstat (limited to 'Doc/library/ast.rst')
| -rw-r--r-- | Doc/library/ast.rst | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index 2192d11f86..e1a8ac0934 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -21,13 +21,12 @@ abstract syntax grammar. The abstract syntax itself might change with each Python release; this module helps to find out programmatically what the current grammar looks like. -An abstract syntax tree can be generated by passing :data:`_ast.PyCF_ONLY_AST` -as a flag to the :func:`compile` builtin function, or using the :func:`parse` +An abstract syntax tree can be generated by passing :data:`ast.PyCF_ONLY_AST` as +a flag to the :func:`compile` builtin function, or using the :func:`parse` helper provided in this module. The result will be a tree of objects whose -classes all inherit from :class:`ast.AST`. +classes all inherit from :class:`ast.AST`. An abstract syntax tree can be +compiled into a Python code object using the built-in :func:`compile` function. -A modified abstract syntax tree can be compiled into a Python code object using -the built-in :func:`compile` function. Node classes ------------ @@ -126,7 +125,7 @@ and classes for traversing abstract syntax trees: .. function:: parse(expr, filename='<unknown>', mode='exec') Parse an expression into an AST node. Equivalent to ``compile(expr, - filename, mode, PyCF_ONLY_AST)``. + filename, mode, ast.PyCF_ONLY_AST)``. .. function:: literal_eval(node_or_string) |
