def _post_attach(self, parent: Self, name: str) -> None:
        """Ensures child has name attribute corresponding to key under which it has been stored."""
        _validate_name(name)  # is this check redundant?
        self._name = name
Ensures child has name attribute corresponding to key under which it has been stored.
xarray/core/treenode.py