We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19f2e47 commit 677fb31Copy full SHA for 677fb31
tests/float/builtin_float_hash.py
@@ -0,0 +1,22 @@
1
+# test builtin hash function with float args
2
+
3
+# these should hash to an integer with a specific value
4
+for val in (
5
+ '0.0',
6
+ '1.0',
7
+ '2.0',
8
+ '-12.0',
9
+ '12345.0',
10
+ ):
11
+ print(val, hash(float(val)))
12
13
+# just check that these values are hashable
14
15
+ '0.1',
16
+ '-0.1',
17
+ '10.3',
18
+ 'inf',
19
+ '-inf',
20
+ 'nan',
21
22
+ print(val, type(hash(float(val))))
tests/float/complex1.py
@@ -41,6 +41,10 @@
41
print(abs(1j))
42
print("%.5g" % abs(1j + 2))
43
44
+# builtin hash
45
+print(hash(1 + 0j))
46
+print(type(hash(1j)))
47
48
# float on lhs should delegate to complex
49
print(1.2 + 3j)
50
0 commit comments