Attributes
- binop
binop = { Const('Add') : Const('+'), Const('Sub') : Const('-'), Const('Mult') : Const('*'), Const('Div') : Const('/'), Const('Mod') : Const('%'), Const('LShift') : Const('>>'), Const('RShift') : Const('<<'), Const('BitOr') : Const('|'), Const('BitXor') : Const('^'), Const('BitAnd') : Const('&'), Const('FloorDiv') : Const('//'), Const('Pow') : Const('**') } - boolops
boolops = { Getattr(Name('_ast'), 'And') : Const('and'), Getattr(Name('_ast'), 'Or') : Const('or') } - cmpops
cmpops = { Const('Eq') : Const('=='), Const('NotEq') : Const('!='), Const('Lt') : Const('<'), Const('LtE') : Const('<='), Const('Gt') : Const('>'), Const('GtE') : Const('>='), Const('Is') : Const('is'), Const('IsNot') : Const('is not'), Const('In') : Const('in'), Const('NotIn') : Const('not in') } - unop
unop = { Const('Invert') : Const('~'), Const('Not') : Const('not'), Const('UAdd') : Const('+'), Const('USub') : Const('-') }
Method summary
- __init__(self, tree, file = sys.stdout)
- dispatch(self, tree)
- enter(self)
- fill(self, text = '')
- leave(self)
- write(self, text)
Methods
- __init__(self, tree, file = sys.stdout)
Unparser(tree, file=sys.stdout) -> None. Print the source for tree to file.
- dispatch(self, tree)
Dispatcher function, dispatching tree type T to method _T.
- enter(self)
Print ':', and increase the indentation.
- fill(self, text = '')
Indent a piece of text, according to the current indentation level
- leave(self)
Decrease the indentation level.
- write(self, text)
Append a piece of text to the current line.