summaryrefslogtreecommitdiffstats
path: root/pattern.py
diff options
context:
space:
mode:
Diffstat (limited to 'pattern.py')
-rw-r--r--pattern.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pattern.py b/pattern.py
index a1919b5..7ff95d8 100644
--- a/pattern.py
+++ b/pattern.py
@@ -81,3 +81,11 @@ class Pattern:
def __repr__(self):
return str(self)
+
+ def __hash__(self):
+ return hash(str(self))
+
+ def __eq__(self, other):
+ if not other.__class__ == Pattern:
+ return False
+ return self.items == other.items and self.invert == other.invert