#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
        Authors:  Burcin Erocal  |     Merged in:                 
   Dependencies:                 |      Stopgaps:                 
---------------------------------+------------------------------------------
Changes (by burcin):

  * status:  needs_info => needs_review


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.

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.take4.patch]

--

Comment:

 Thanks for reviewing this ticket!

 New patch up at [attachment:trac_9016-morphishm_hash.take4.patch] with
 32-bit hash values. I removed the `# indirect doctest` messages as well.
 Perhaps the coverage script improved in the mean time to avoid complaints
 about not using the name of the function in the tests.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9016#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 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.

Reply via email to