def trace(self, node):
        "Debugging utility for tracing the validation of AST nodes."
        print classname(node)
        for attr in dir(node):
            if attr[:2] != '__':
                print ' ' * 4, "%-15.15s" % attr, getattr(node, attr)
Debugging utility for tracing the validation of AST nodes.
recipes/Python/496746_Restricted_safe_eval/recipe-496746.py