Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(0)  |  Derive(2)  |  Import(0)
The TreeWalk class can be used as a superclass in order
to walk an AST or similar tree.

Unlike other treewalkers, this class can walk a tree either
recursively or non-recursively.  Subclasses can define
methods with the following signatures::

    def pre_xxx(self):
        pass
(more...)

src/a/s/astor-HEAD/tests/test_transform.py   astor(Download)
class ConsolidateAttributes(astor.TreeWalk):
    def post_Attribute(self):
        node = self.cur_node
        value = node.value
        value.id += '.' + node.attr
        self.replace(value)
 
ConsolidateAttributes(func_ast)
 
class FindNames(astor.TreeWalk):