def __hash__(self): return hash((self.text, str(ordered(self.data))))
def __eq__(self, other): if not isinstance(other, Message): return False else: return (other.text, ordered(other.data)) == (self.text, ordered(self.data))