#19302: Stopgap for Element.__hash__
-------------------------+-------------------------------------------------
Reporter: | Owner:
ncohen | Status: needs_review
Type: | Milestone: sage-6.9
defect | Resolution:
Priority: | Merged in:
blocker | Reviewers:
Component: misc | Work issues:
Keywords: | Commit:
Authors: | 39f4d3cf9c82bc17097eb761e80a4033cc38148f
Nathann Cohen | Stopgaps:
Report Upstream: N/A |
Branch: |
public/19302 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by nbruin):
Replying to [comment:14 was]:
> The exact same issue occurs with `Mod(3,5) == 8`. Different hashes,
compares equal.
I think the consensus was that this is a different issue: equality isn't
transitive *across different parents*, and hence "equal => equal hash"
cannot hold. However, within a parent we do need to try and keep "=="
transitive, and we should try to have "equal => equal hash". In cases
where we cannot do this, we should make elements unhashable. Via the
"_cache_key" method we can still allow such objects to appear as part of
cache keys.
I do think that sage 6.9 could still have this flaw unflagged, but we
should really try to fix 6.10 significantly in this respect, and progress
has shown this is quite attainable (there probably plenty of other bad
hashes around but the "hash(str(self))" catchall is definitely a bad
offender)
So I'd say: merge the stopgap right after the 6.9 release to ensure we fix
this stuff.
--
Ticket URL: <http://trac.sagemath.org/ticket/19302#comment:15>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.