diff --git a/rbackup/struct/hierarchy.py b/rbackup/struct/hierarchy.py index 4f9dd72..026940d 100644 --- a/rbackup/struct/hierarchy.py +++ b/rbackup/struct/hierarchy.py @@ -46,9 +46,18 @@ class Hierarchy(PathLike): self.path.mkdir(DIRMODE, parents=True, exist_ok=True) + def __eq__(self, other): + return self._path == other.path + def __fspath__(self): return str(self._path) + def __hash__(self): + return hash(self._path) + + def __ne__(self, other): + return self._path != other.path + def __repr__(self): """Return a string representation of this Hierarchy.""" return f"{self.__class__.__name__}('{self._path}')"