[pypy-svn] r23829 - pypy/dist/pypy/lib/logic/computation_space
auc at codespeak.net
auc at codespeak.net
Wed Mar 1 15:37:29 CET 2006
Author: auc
Date: Wed Mar 1 15:37:27 2006
New Revision: 23829
Modified:
pypy/dist/pypy/lib/logic/computation_space/constraint.py
Log:
bogus equality tests
Modified: pypy/dist/pypy/lib/logic/computation_space/constraint.py
==============================================================================
--- pypy/dist/pypy/lib/logic/computation_space/constraint.py (original)
+++ pypy/dist/pypy/lib/logic/computation_space/constraint.py Wed Mar 1 15:37:27 2006
@@ -125,6 +125,9 @@
def copy_to(self, space):
return self.__class__(space, self._variables)
+ def __eq__(self, other): #FIXME and parent
+ if not isinstance(other, self.__class__): return False
+ return self._variables == other._variables
class BasicConstraint(object):
"""A BasicConstraint, which is never queued by the Repository
@@ -169,6 +172,8 @@
repr(self))
return 1
+ def __eq__(self, other):
+ raise NotImplementedError
def make_lambda_head(vars):
var_ids = ','.join([var.name for var in vars])
@@ -268,6 +273,13 @@
return maybe_entailed
+ def __eq__(self, other):
+ if not super(Expression, self).__eq__(other): return False
+ r1 = self.formula == other.formula
+ r2 = self.type == other.type
+ return r1 and r2
+
+
def __repr__(self):
return '<%s>' % self.formula
More information about the Pypy-commit
mailing list