1
0
blueloveTH 1 жил өмнө
parent
commit
0a75eb857c

+ 1 - 3
src/public/py_number.c

@@ -244,9 +244,7 @@ static py_i64 c11_8bytes__hash(union c11_8bytes u) {
 
 static bool int__hash__(int argc, py_Ref argv) {
     PY_CHECK_ARGC(1);
-    py_i64 val = py_toint(&argv[0]);
-    union c11_8bytes u = {._i64 = val};
-    py_newint(py_retval(), c11_8bytes__hash(u));
+    py_assign(py_retval(), argv);
     return true;
 }
 

+ 10 - 0
tests/08_dict.py

@@ -138,3 +138,13 @@ for i in range(n):
 #     if i % 3 == 0:
 #         y = b.pop()
 #         delattr(a, y)
+
+d = {}
+for i in range(-1000, 1000):
+    d[i] = i
+    assert d[i] == i
+
+e = {}
+for i in range(-10000, 10000, 3):
+    e[i] = i
+    assert e[i] == i