#11115: Rewrite cached_method in Cython
---------------------------+------------------------------------------------
   Reporter:  SimonKing    |          Owner:  jason                
       Type:  enhancement  |         Status:  needs_info           
   Priority:  major        |      Milestone:  sage-4.7             
  Component:  misc         |       Keywords:  category cython cache
Work_issues:               |       Upstream:  N/A                  
   Reviewer:               |         Author:  Simon King           
     Merged:               |   Dependencies:                       
---------------------------+------------------------------------------------

Comment(by SimonKing):

 Unfortunately, there was no reaction from sage-devel, and my question has
 already disappeared from the first screen.

 I see an alternative to a new attribute `__cached_methods` for all
 elements: Since that attribute will only be used if the element does not
 allow attribute assignment, and since only few element classes use cached
 methods, it might be a good compromise to introduce the `__cached_methods`
 attribute only in those derived classes that really need it.

 Hence, you would write
 {{{
 cdef class MyElementClass(Element):
     cdef public dict __cached_methods
     cdef ...
     def __init__(...)
 }}}
 if `MyElementClass` does not accept attribute assignment but is supposed
 to inherit cached methods from the category framework.

 I do suggest to keep the additional attribute for
 sage.structure.parent.Parent, though. As you said, parents are big and
 rare enough that an additional attribute is no real burden.

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