module documentation

ast ~~~ This is a stripped down version of Armin Ronacher's ast module. :copyright: Copyright 2008 by Armin Ronacher. :license: Python License.

Class NodeTransformer Walks the abstract syntax tree and allows modifications of nodes.
Class NodeVisitor Walks the abstract syntax tree and call visitor functions for every node found. The visitor functions may return values which will be forwarded by the `visit` method.
Class SourceGenerator This visitor is able to transform a well formed syntax tree into python sourcecode. For more details have a look at the docstring of the `node_to_source` function.
Function iter_fields Iterate over all fields of a node, only yielding existing fields.
Function parse Parse an expression into an AST node.
Constant ALL_SYMBOLS Undocumented
Constant BINOP_SYMBOLS Undocumented
Constant BOOLOP_SYMBOLS Undocumented
Constant CMPOP_SYMBOLS Undocumented
Constant UNARYOP_SYMBOLS Undocumented
def iter_fields(node): (source)

Iterate over all fields of a node, only yielding existing fields.

def parse(expr, filename='<unknown>', mode='exec'): (source)

Parse an expression into an AST node.

ALL_SYMBOLS: dict = (source)

Undocumented

Value
{}
BINOP_SYMBOLS = (source)

Undocumented

Value
{Add: '+',
 Sub: '-',
 Mult: '*',
 Div: '/',
 FloorDiv: '//',
 Mod: '%',
 LShift: '<<',
...
BOOLOP_SYMBOLS = (source)

Undocumented

Value
{And: 'and', Or: 'or'}
CMPOP_SYMBOLS = (source)

Undocumented

Value
{Eq: '==',
 Gt: '>',
 GtE: '>=',
 In: 'in',
 Is: 'is',
 IsNot: 'is not',
 Lt: '<',
...
UNARYOP_SYMBOLS = (source)

Undocumented

Value
{Invert: '~', Not: 'not', UAdd: '+', USub: '-'}