Opened 4 years ago
Closed 4 years ago
#25935 closed defect (fixed)
Make __eq__ and __hash__ of AbelianGroup_class consistent
Reported by: | jdemeyer | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.4 |
Component: | group theory | Keywords: | |
Cc: | jhpalmieri | Merged in: | |
Authors: | John Palmieri | Reviewers: | Jeroen Demeyer |
Report Upstream: | N/A | Work issues: | |
Branch: | 6c25916 (Commits, GitHub, GitLab) | Commit: | 6c25916cdca7fbfc6f7d89b3bc0c5d04ebea7fdd |
Dependencies: | Stopgaps: |
Description
AbelianGroup_class
inherits its __hash__
from UniqueRepresentation
but it has a different __eq__
:
__eq__ = is_isomorphic
Either we should remove that special __eq__
or we should make __hash__
consistent with __eq__
.
Change History (8)
comment:1 Changed 4 years ago by
- Branch set to u/jhpalmieri/abelian_gp_eq
comment:2 Changed 4 years ago by
- Commit set to 6c25916cdca7fbfc6f7d89b3bc0c5d04ebea7fdd
comment:3 Changed 4 years ago by
- Status changed from new to needs_review
I'll mark this as "needs review", but feel free to disagree with the approach.
comment:4 Changed 4 years ago by
I agree with the proposal, but we'll need to see if it passes tests.
comment:5 follow-up: ↓ 7 Changed 4 years ago by
Note that I did not add __hash__ = UniqueRepresentation.__hash__
. That can wait until a Python 3 focused ticket, like #24551.
comment:6 Changed 4 years ago by
- Reviewers set to Jeroen Demeyer
- Status changed from needs_review to positive_review
comment:7 in reply to: ↑ 5 Changed 4 years ago by
Replying to jhpalmieri:
Note that I did not add
__hash__ = UniqueRepresentation.__hash__
.
There shouldn't be a reason for that.
comment:8 Changed 4 years ago by
- Branch changed from u/jhpalmieri/abelian_gp_eq to 6c25916cdca7fbfc6f7d89b3bc0c5d04ebea7fdd
- Resolution set to fixed
- Status changed from positive_review to closed
Well, I removed
__eq__
and__ne__
and there were only a few doctest failures. So I say we go this route.New commits:
trac 25935: remove __eq__ for AbelianGroup_class: it should inherit __eq__