We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e613be commit 0509b8bCopy full SHA for 0509b8b
2 files changed
src/flint/test/test_all.py
@@ -1382,6 +1382,8 @@ def test_nmod():
1382
assert G(3,5) == G(8,5)
1383
assert G(1,2) != (1,2)
1384
assert isinstance(hash(G(3, 5)), int)
1385
+ x = G(1, 7)
1386
+ assert hash(x) == hash(G(1, 7))
1387
assert raises(lambda: G([], 3), TypeError) # type: ignore
1388
#assert G(3,5) == 8 # do we want this?
1389
#assert 8 == G(3,5)
src/flint/types/nmod.pyx
@@ -94,7 +94,7 @@ cdef class nmod(flint_scalar):
94
return NotImplemented
95
96
def __hash__(self):
97
- return hash((int(self.val), self.modulus))
+ return hash((int(self.val), self.modulus()))
98
99
def __bool__(self):
100
return self.val != 0
0 commit comments