module documentation

Debugging utilities.

Function dump Return a formatted dump of the tree in *node*.
def dump(node, ast, annotate_fields=True, include_attributes=True, indent=' '): (source)

Return a formatted dump of the tree in *node*. This is mainly useful for debugging purposes. The returned string will show the names and the values for fields. This makes the code impossible to evaluate, so if evaluation is wanted *annotate_fields* must be set to False. Attributes such as line numbers and column offsets are dumped by default. If this is not wanted, *include_attributes* can be set to False. Arguments: node: Top AST node. ast: An module providing an AST class hierarchy. annotate_fields: Show field annotations. include_attributes: Show all attributes. indent: Indentation string. Returns: A formatted tree.