FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix nmod hash by ForeverHaibara · Pull Request #374 · flintlib/python-flint · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) .py  (1) .pyx  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 2 additions & 0 deletions README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ Contributors (0.9.0):
- Agriya Khetarpal (AK)
- Oscar Benjamin (OB)
- Daniel Simmons-Marengo (DSM)
- ForeverHaibara (FH)

Changes (0.9.0):

Expand All @@ -196,6 +197,7 @@ Changes (0.9.0):
Faster conversion from `int` to `fmpz` and back. (RO).
- [gh-359](https://github.com/flintlib/python-flint/pull/359),
Sort factorisations of all mpoly types. (OB)
- [gh-374](https://github.com/flintlib/python-flint/pull/374), Fixed a bug in `nmod.__hash__`. (FH)

0.8.0
-----
Expand Down
2 changes: 2 additions & 0 deletions src/flint/test/test_all.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,8 @@ def test_nmod():
assert G(3,5) == G(8,5)
assert G(1,2) != (1,2)
assert isinstance(hash(G(3, 5)), int)
x = G(1, 7)
assert hash(x) == hash(G(1, 7))
assert raises(lambda: G([], 3), TypeError) # type: ignore
#assert G(3,5) == 8 # do we want this?
#assert 8 == G(3,5)
Expand Down
2 changes: 1 addition & 1 deletion src/flint/types/nmod.pyx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ cdef class nmod(flint_scalar):
return NotImplemented

def __hash__(self):
return hash((int(self.val), self.modulus))
return hash((int(self.val), self.modulus()))

def __bool__(self):
return self.val != 0
Expand Down
Loading

Back | FazBrowse Home | New Git URL