def ancestors(self: Tree) -> tuple[Tree, ...]:
        """All parent nodes and their parent nodes, starting with the most distant."""

        from warnings import warn

        warn(
            "`ancestors` has been deprecated, and in the future will raise an error."
            "Please use `parents`. Example: `tuple(reversed(node.parents))`",
            DeprecationWarning,
            stacklevel=2,
        )
        return (*reversed(self.parents), self)
All parent nodes and their parent nodes, starting with the most distant.
xarray/core/treenode.py