Commits

Martin Vejnár  committed 09b0944

The Rule objects can now be correctly compared.

  • Participants
  • Parent commits 73c4f93

Comments (0)

Files changed (1)

         self.left = left
         self.right = right
         self.action = kwarg.get('action', lambda ctx, *args: args)
+        
+    def __eq__(self, other):
+        return (self.left, self.right, self.action) == (other.left, other.right, self.action)
     
+    def __hash__(self):
+        return hash((self.left, self.right, self.action))
+
     def __str__(self):
         """
         >>> print Rule('a', 'b', 'c')