#11943: The category graph should comply with Python's method resolution order
-----------------------------------------------------------------------------------------------------------+
   Reporter:  SimonKing                                                         
                           |          Owner:  nthiery                           
     
       Type:  enhancement                                                       
                           |         Status:  needs_work                        
     
   Priority:  major                                                             
                           |      Milestone:  sage-4.7.3                        
     
  Component:  categories                                                        
                           |       Keywords:  category graph, method resolution 
order
Work_issues:  Preserve super_categories etc. as methods, but introduce a lazy 
attribute _super_categories  |       Upstream:  N/A                             
       
   Reviewer:                                                                    
                           |         Author:  Simon King                        
     
     Merged:                                                                    
                           |   Dependencies:  #11900                            
     
-----------------------------------------------------------------------------------------------------------+

Comment(by SimonKing):

 I think the following model is best for preserving backwards
 compatibility:

  * If one wants to provide the super categories of a category, one should
 implement a method super_categories() - this is what one would currently
 do.
  * There is a new lazy attribute _super_categories defined for the base
 class of categories. That lazy attribute calls the method
 super_categories(). Of course, calling the method happens only once, so
 that the speed is acceptable.
  * In all ''applications'', the method call super_categories() shall be
 replaced by getting the attribute _super_categories. That is explained in
 a note to the developers in the documentation of super_categories.
  * There is a lazy attribute _all_super_categories and
 _all_super_categories_proper, and there is still a method
 all_super_categories(proper=False). The method returns the appropriate
 lazy attribute, and the documentation of the method states that one should
 better use the lazy attributes.

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