#13589: Controlling C3 to solve once for all the Method Resolution Order issues 
for
category classes
----------------------------------------------------------+-----------------
       Reporter:  nthiery                                 |         Owner:  
nthiery                   
           Type:  defect                                  |        Status:  
needs_review              
       Priority:  major                                   |     Milestone:  
sage-5.11                 
      Component:  categories                              |    Resolution:      
                      
       Keywords:  method resolution order, C3             |   Work issues:      
                      
Report Upstream:  N/A                                     |     Reviewers:  
Simon King, Florent Hivert
        Authors:  Nicolas M. ThiƩry                       |     Merged in:      
                      
   Dependencies:  #12894, #12876, #11935, #12895, #10193  |      Stopgaps:      
                      
----------------------------------------------------------+-----------------

Comment (by SimonKing):

 This is a minimal example of what Nicolas wants to do:
 {{{
 sage: class A(object):
     @lazy_attribute
     def x(self):
         print "computing the attribute with A"
         return 1
 ....:
 sage: class B(A):
     @lazy_attribute
     def x(self):
         print "this is lazy attribute with B"
         r= super(B,self).x
         self.y = r
         return r
 ....:
 sage: b = B()
 sage: b.x
 this is lazy attribute with B
 computing the attribute with A
 1
 sage: b.y
 1
 }}}

 So, it seems to work with lazy attribute, and this will be much faster
 than calling a method (repeatedly). Trying to change it now.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13589#comment:42>
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to