def describe()

in readability/debug.py [0:0]


def describe(node, depth=1):
    global uids, uids_document
    doc = node.getroottree().getroot()
    if doc != uids_document:
        uids = {}
        uids_document = doc

    # return repr(NodeRepr(node))
    parent = ""
    if depth and node.getparent() is not None:
        parent = describe(node.getparent(), depth=depth - 1) + ">"
    return parent + describe_node(node)