'Return the height of the tree, or the depth of the
deepest node.'

@property
def height(self):

    stack = [0]
    max_depth = 0
    for elem in self:
        depth = stack.pop()
        max_depth = max(max_depth, depth)
        stack.extend(([(depth + 1)] * elem.arity))
    return max_depth
