#9016: make morphisms hashable
---------------------------------+------------------------------------------
Reporter: burcin | Owner: AlexGhitza
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.6
Component: categories | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Robert Bradshaw, Travis
Scrimshaw
Authors: Burcin Erocal | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Changes (by burcin):
* reviewer: Robert Bradshaw => Robert Bradshaw, Travis Scrimshaw
Old description:
> Attached patch makes morphisms hashable in a reasonably fast way by
> defining the following:
>
> {{{
> def __hash__(self):
> return hash((self._domain, self._codomain))
> }}}
>
> It also defines specialized methods for
> `sage.rings.morphism.RingHomomorphism_im_gens` and
> `sage.rings.morphism.RingHomomorphism_from_quotient`.
>
> While testing the code for `im_gens`, I fixed a confusing error message
> in `sage.structure.sequence.Sequence.__hash__()` as well.
>
> Apply: [attachment:trac_9016-morphishm_hash.take4.patch]
New description:
Attached patch makes morphisms hashable in a reasonably fast way by
defining the following:
{{{
def __hash__(self):
return hash((self._domain, self._codomain))
}}}
It also defines specialized methods for
`sage.rings.morphism.RingHomomorphism_im_gens` and
`sage.rings.morphism.RingHomomorphism_from_quotient`.
While testing the code for `im_gens`, I fixed a confusing error message in
`sage.structure.sequence.Sequence.__hash__()` as well.
Apply: [attachment:trac_9016-morphishm_hash.take5.patch]
--
Comment:
Replying to [comment:16 tscrim]:
> Looks much better now. Two more minor things (sorry for not noticing
this earlier):
Thanks for the quick feedback. I attached
[attachment:trac_9016-morphishm_hash.take5.patch a new patch] fixing the
two issues mentioned above.
Patchbot, apply trac_9016-morphishm_hash.take5.patch
I guess it's too late to fix the horrific typo in the file name. :)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9016#comment:17>
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.