+ def object_id(self) -> str:
+ """Return a unique string representing this object."""
+ return "Undefined. for <%s %s>" % (self.__class__.__name__, id(self))
+
+ def __str__(self) -> str:
+ return self.object_id()
+
+ def __repr__(self) -> str:
+ return "<%s>" % self.object_id()
+
+ def __hash__(self) -> int:
+ return hash(self.object_id())
+
+ def __eq__(self, other) -> bool:
+ if not isinstance(other, self.__class__):
+ return NotImplemented
+ if other.object_id() == self.object_id():
+ return True
+ return False
+
+ # This can be removed when python2 support is dropped.
+ def __ne__(self, other):
+ return not self.__eq__(other)
+