[pypy-svn] r58764 - pypy/branch/2.5-merge/pypy/objspace/std/test

cfbolz at codespeak.net cfbolz at codespeak.net
Tue Oct 7 16:42:58 CEST 2008


Author: cfbolz
Date: Tue Oct  7 16:42:57 2008
New Revision: 58764

Modified:
   pypy/branch/2.5-merge/pypy/objspace/std/test/test_set.py
Log:
failing set test


Modified: pypy/branch/2.5-merge/pypy/objspace/std/test/test_set.py
==============================================================================
--- pypy/branch/2.5-merge/pypy/objspace/std/test/test_set.py	(original)
+++ pypy/branch/2.5-merge/pypy/objspace/std/test/test_set.py	Tue Oct  7 16:42:57 2008
@@ -91,3 +91,17 @@
             assert e.args[0] == 1
         else:
             assert 0, "should raise"
+
+    def test_subclass_with_hash(self):
+        # Bug #1257731
+        class H(set):
+            def __hash__(self):
+                return int(id(self) & 0x7fffffff)
+        s = H()
+        f = set([s])
+        print f
+        assert s in f
+        f.remove(s)
+        f.add(s)
+        f.discard(s)
+



More information about the Pypy-commit mailing list