31.2. ast — Abstract Syntax Trees — Python 2.7.8 documentation

index modules | next | previous | Python » 2.7.8 Documentation » The Python Standard Library » 31. Python Language Services » ast ¶ New in version 2.5: The low-level _ast module containing only the node classes. New in version 2.6: The high-level ast module containing all helpers. Source code: Lib/ast.py The ast module helps Python applications to process trees of the Python 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 ast.PyCF_ONLY_AST as a flag to the compile() built-in function, or using the parse() helper provided in this module. The result will be a tree of objects whose classes all inherit from ast.AST . An abstract syntax tree can be compiled into a Python code object u...

Linked on 2014-10-30 21:07:54 | Similar Links