#14214: Cythoned homsets
----------------------------------------------+-----------------------------
       Reporter:  SimonKing                   |         Owner:  tbd             
                 
           Type:  enhancement                 |        Status:  needs_work      
                 
       Priority:  major                       |     Milestone:  sage-5.10       
                 
      Component:  performance                 |    Resolution:                  
                 
       Keywords:  Hom, cython, cached method  |   Work issues:  How to store 
domain and codomain?
Report Upstream:  N/A                         |     Reviewers:                  
                 
        Authors:  Simon King                  |     Merged in:                  
                 
   Dependencies:  #14159, #12951, #13184      |      Stopgaps:                  
                 
----------------------------------------------+-----------------------------

Comment (by nbruin):

 Replying to [comment:56 nbruin]:
 > Replying to [comment:55 SimonKing]:
 > > And I guess you could get it still a bit faster, if you do `def
 __get__(self, Parent instance, cls)`, because our homsets are parents, and
 because the cdef public attribute `__cached_methods` could be accessed
 more quickly if the instance is known to be a Parent.
 >
 > Excellent idea! if `__cached_method` isn't in a slot then we wouldn't
 want to use it anyway. It does mean that we lose flexibility: If for some
 reason, we have a class that can't inherit directly from Parent but does
 want to cooperate in this protocol, it won't be able to.

 Note that `_element_class` on `Parent` is a `@lazy_attribute`. That code
 could benefit from a `Parent instance` too, so perhaps you DO want to use
 an (adapted form of) `@lazy_attribute` for both. In the case of `_domain`
 and `_codomain`, the wrapped function would be irrelevant.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14214#comment:65>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to