Skip to content
Snippets Groups Projects
Commit 3bf66a7f authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Equality comparison and hashability for DTAG_BOUNDARY

parent 91a70593
No related branches found
No related tags found
No related merge requests found
...@@ -124,6 +124,18 @@ class DTAG_BOUNDARY: # noqa ...@@ -124,6 +124,18 @@ class DTAG_BOUNDARY: # noqa
def __init__(self, tag): def __init__(self, tag):
self.tag = tag self.tag = tag
def __eq__(self, other):
return isinstance(other, DTAG_BOUNDARY) and self.tag == other.tag
def __ne__(self, other):
return not self.__eq__(other)
def __hash__(self):
return hash(type(self)) ^ hash(self.tag)
def __repr__(self):
return "<%s(%s)>" % (type(self).__name__, repr(self.tag))
class QTAG_NONE: # noqa class QTAG_NONE: # noqa
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment