diff --git a/earthsnake/identity.py b/earthsnake/identity.py index 169e9bb..25c0e9c 100644 --- a/earthsnake/identity.py +++ b/earthsnake/identity.py @@ -168,3 +168,6 @@ class Identity: return False return True + + def hash(self) -> int: + return hash(str(self)) diff --git a/earthsnake/path.py b/earthsnake/path.py index 1da6edc..6721486 100644 --- a/earthsnake/path.py +++ b/earthsnake/path.py @@ -94,3 +94,6 @@ class Path: """Check if path ends with sub""" return self.path.endswith(sub) + + def __hash__(self) -> int: + return hash(self.path)