]> granicus.if.org Git - python/commitdiff
Fix for test_class.py on Win64. id(self), which on Win64 returns a
authorTrent Mick <trentm@activestate.com>
Wed, 4 Oct 2000 17:50:59 +0000 (17:50 +0000)
committerTrent Mick <trentm@activestate.com>
Wed, 4 Oct 2000 17:50:59 +0000 (17:50 +0000)
PyLong, was used for the return value of a class __hash__ method, which
*must* return a PyInt. Solution: hash() the id(self) value.

Lib/test/test_class.py

index 1fc9971731625ccdb6126df5e31477d39fae5956..43c1d3b5181f07acf6205ac54d51a11863b07d53 100644 (file)
@@ -71,7 +71,7 @@ class AllTests:
 
     def __hash__(self, *args):
         print "__hash__:", args
-        return id(self)
+        return hash(id(self))
 
     def __str__(self, *args):
         print "__str__:", args