#9016: make morphisms hashable
-------------------------------+--------------------------------------------
Reporter: burcin | Owner: AlexGhitza
Type: defect | Status: needs_info
Priority: major | Milestone: sage-4.7.1
Component: categories | Keywords:
Work_issues: | Upstream: N/A
Reviewer: Robert Bradshaw | Author: Burcin Erocal
Merged: | Dependencies:
-------------------------------+--------------------------------------------
Changes (by robertwb):
* type: enhancement => defect
Comment:
Replying to [comment:12 burcin]:
> I don't see how the string representation could provide more information
than the data stored in the class. I would be happy to add such data to
the tuple that is hashed if you point it out.
The string representation is more often overridden to be distinct for
distinct morphisms
> The current patch uses the hash of the images of the generators when the
morphism class contains this information. See line 1103 of
`sage/rings/morphism.pyx` for example. In order to implement your
suggestion we would also have to change the comparison functions, which
compare the same data this patch hashes.
Are you saying that any two morphisms in the same homset compare equal?
That is a bug for sure. I'd rather not be able to compare such morphisms.
> <rant>
> Robert, even though you chose to mark this as an enhancement in
comment:3, it is actually a bug that effects my work. The category
framework relies heavily on cached functions, which in turn need the
arguments of these to be hashable. For example, I need unique parents that
also depend on a morphism/map (difference/differential rings). I opened
this ticket when I ran into this problem a year ago.
Happy to change it back given the context.
> I know I haven't really pushed it through, but it still is a shame that
it takes so long for such a small change to get into a release.
> </rant>
I know this all to well--too much bureaucracy and churn in the code among
other things. That was one of my primary motivations for the patchbot, so
hopefully simple changes could get approved quickly.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9016#comment:13>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.