Changeset 391 for python/trunk/Doc/library/ast.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/library/ast.rst
r2 r391 1 .. _ast: 2 3 Abstract Syntax Trees 4 ===================== 1 :mod:`ast` --- Abstract Syntax Trees 2 ==================================== 5 3 6 4 .. module:: ast … … 16 14 The high-level ``ast`` module containing all helpers. 17 15 16 **Source code:** :source:`Lib/ast.py` 17 18 -------------- 18 19 19 20 The :mod:`ast` module helps Python applications to process trees of the Python … … 123 124 and classes for traversing abstract syntax trees: 124 125 125 .. function:: parse( expr, filename='<unknown>', mode='exec')126 127 Parse an expression into an AST node. Equivalent to ``compile(expr,126 .. function:: parse(source, filename='<unknown>', mode='exec') 127 128 Parse the source into an AST node. Equivalent to ``compile(source, 128 129 filename, mode, ast.PyCF_ONLY_AST)``. 129 130 … … 131 132 .. function:: literal_eval(node_or_string) 132 133 133 Safely evaluate an expression node or a string containing a Python134 expression. The string or node provided may only consist of the following135 Python literal structures: strings, numbers, tuples, lists, dicts, booleans,136 and ``None``.134 Safely evaluate an expression node or a Unicode or *Latin-1* encoded string 135 containing a Python expression. The string or node provided may only consist 136 of the following Python literal structures: strings, numbers, tuples, lists, 137 dicts, booleans, and ``None``. 137 138 138 139 This can be used for safely evaluating strings containing Python expressions … … 183 184 .. function:: walk(node) 184 185 185 Recursively yield all child nodes of *node*, in no specified order. This is186 useful if you only want to modify nodes in place and don't care about the187 context.186 Recursively yield all descendant nodes in the tree starting at *node* 187 (including *node* itself), in no specified order. This is useful if you only 188 want to modify nodes in place and don't care about the context. 188 189 189 190
Note:
See TracChangeset
for help on using the changeset viewer.