Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r65475:b8ebf0cf310f
Date: 2013-07-18 16:30 -0700
http://bitbucket.org/pypy/pypy/changeset/b8ebf0cf310f/
Log: adapt to py3's __hash/eq/cmp__ changes
diff --git a/pypy/objspace/std/test/test_identityset.py
b/pypy/objspace/std/test/test_identityset.py
--- a/pypy/objspace/std/test/test_identityset.py
+++ b/pypy/objspace/std/test/test_identityset.py
@@ -23,10 +23,7 @@
class CustomEq(object):
def __eq__(self, other):
return True
-
- class CustomCmp (object):
- def __cmp__(self, other):
- return 0
+ __hash__ = object.__hash__
class CustomHash(object):
def __hash__(self):
@@ -40,7 +37,7 @@
assert self.uses_strategy('IdentitySetStrategy',s)
- for cls in [CustomEq,CustomCmp,CustomHash]:
+ for cls in [CustomEq,CustomHash]:
s = set()
s.add(cls())
assert not self.uses_strategy('IdentitySetStrategy',s)
@@ -64,6 +61,7 @@
class NotIdent(object):
def __eq__(self,other):
pass
+ __hash__ = object.__hash__
s = set([X(),X()])
s.add('foo')
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit