Permalink
Browse files

add hash function for fofTypes

  • Loading branch information...
slomo committed Oct 5, 2012
1 parent 9bbbddc commit 7a48cf667f1eedb1cd760b75a67eabed144cfc7e
Showing with 5 additions and 2 deletions.
  1. +5 −2 fofTypes.py
View
@@ -13,7 +13,7 @@ def __eq__(self,other):
return repr(self) == repr(other)
def __hash__(self):
- return int(repr(self))
+ return hash(self.op) ^ hash(self.term)
class BinaryOperand(object):
@@ -27,7 +27,7 @@ def __eq__(self,other):
return repr(self) == repr(other)
def __hash__(self):
- return int(repr(self))
+ return hash(self.op) ^ hash(self.terms)
class Identifier(object):
@@ -40,6 +40,9 @@ def __repr__(self):
def __eq__(self,other):
return repr(self) == repr(other)
+ def __hash__(self):
+ return hash(self.name)
+
class Quantor(object):
def __init__(self, string, variables, term):

0 comments on commit 7a48cf6

Please sign in to comment.