has_parent

returns True if the element has a parent element.

Source


def has_parent(self):
    return False if self._parent is None else True