'Returns ``True`` if *other* is in this tokens ancestry.'

def has_ancestor(self, other):

    parent = self.parent
    while parent:
        if (parent == other):
            return True
        parent = parent.parent
    return False
