[pypy-svn] rev 2655 - pypy/trunk/src/pypy/objspace/std

alex at codespeak.net alex at codespeak.net
Sat Dec 20 15:52:13 CET 2003


Author: alex
Date: Sat Dec 20 15:52:12 2003
New Revision: 2655

Modified:
   pypy/trunk/src/pypy/objspace/std/tupleobject.py
Log:
implement a simple but correct hash for tuples



Modified: pypy/trunk/src/pypy/objspace/std/tupleobject.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/tupleobject.py	(original)
+++ pypy/trunk/src/pypy/objspace/std/tupleobject.py	Sat Dec 20 15:52:12 2003
@@ -108,5 +108,8 @@
     # XXX slimy! --mwh
     return space.wrap(repr(space.unwrap(w_tuple)))
 
+def hash__Tuple(space, w_tuple):
+    # silly-ish, but _correct_, while lacking it would be WRONG
+    return space.len(w_tuple)
 
 register_all(vars())


More information about the Pypy-commit mailing list