#19016: A more naive sage.structure.element.__hash__
-------------------------+-------------------------------------------------
Reporter: | Owner:
ncohen | Status: needs_review
Type: | Milestone: sage-duplicate/invalid/wontfix
defect | Resolution:
Priority: | Merged in:
blocker | Reviewers:
Component: misc | Work issues:
Keywords: | Commit:
Authors: | 754dc5794a1a7004c8844cf7cfb64220957c36a5
Nathann Cohen | Stopgaps:
Report Upstream: N/A |
Branch: |
u/ncohen/19016 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by vdelecroix):
Replying to [comment:15 vbraun]:
> The default `__hash__` could be moved from Element to a
!CanonicalRepresentation (or so) category. After injecting that into a few
basic categories there are probably not that many parents where it has to
be added by hand... thoughts?
That might be an easy move since we would just have to change the category
to something like `PreviousCategory().WithCanonicalRepresentation()`. For
me this has to be done on a case by case basis for each `Parent`. The
advantage would be the simplicity. But I found that this would mostly move
the problem. But it would be better, because explicit in the parent
implementation.
But in the long run, do we really want to use only once the string
representation for the hash? Is that how we want the user to implement
their own `Parent/Element`? I like Nathann's idea of having a warning if
the default hash is called (and the default could be either
`hash(repr(P))` or `0` I do not really care).
--
Ticket URL: <http://trac.sagemath.org/ticket/19016#comment:16>
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.