ast
ast — Abstract Syntax Trees
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()
登录查看完整内容