Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d68d0a6

Browse files
author
Trent Mick
committed
Fix for test_class.py on Win64. id(self), which on Win64 returns a
PyLong, was used for the return value of a class __hash__ method, which *must* return a PyInt. Solution: hash() the id(self) value.
1 parent b2c2c9e commit d68d0a6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/test/test_class.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __coerce__(self, *args):
7171

7272
def __hash__(self, *args):
7373
print "__hash__:", args
74-
return id(self)
74+
return hash(id(self))
7575

7676
def __str__(self, *args):
7777
print "__str__:", args

0 commit comments

Comments
 (0)