diff --git a/attributs.py b/attributs.py index c4152a7..cf65fd7 100644 --- a/attributs.py +++ b/attributs.py @@ -271,6 +271,12 @@ class Attr(object): self.parent = Parent self.parse_value(val) + def __hash__(self): + if hasattr(self.value, "__hash__") and self.value.__hash__ is not None: + return self.value.__hash__() + else: + return str(self).__hash__() + def __eq__(self, item): if isinstance(item, self.__class__): return str(self) == str(item)