We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c50772d commit 7bab32eCopy full SHA for 7bab32e
1 file changed
tests/basics/builtin_hash.py
@@ -42,3 +42,15 @@ def __hash__(self):
42
hash(D())
43
except TypeError:
44
print("TypeError")
45
+
46
+# __hash__ returning a bool should be converted to an int
47
+class E:
48
+ def __hash__(self):
49
+ return True
50
+print(hash(E()))
51
52
+# __hash__ returning a large number should be truncated
53
+class F:
54
55
+ return 1 << 70 | 1
56
+print(hash(F()) != 0)
0 commit comments