#7448: Improve sphinx rendering of categories in reference manual.
--------------------------+-------------------------------------------------
   Reporter:  hivert      |       Owner:  hivert            
       Type:  defect      |      Status:  needs_info        
   Priority:  major       |   Milestone:                    
  Component:  categories  |    Keywords:  Sphinx categories.
     Author:              |    Upstream:  N/A               
   Reviewer:              |      Merged:                    
Work_issues:              |  
--------------------------+-------------------------------------------------

Comment(by hivert):

 > I've made some experiments. Actually it seems that the problem is a bad
 interaction between sphinx and the particular metaclass
 {{{NestedMetaclass}}} we have to use to work around the nested class
 pickling bug of python. If you apply the attached patch, you'll see that
 {{{TestParent1}}} is correctly rendered whereas the other parent are not.
 I think this is a lead which should be followed.

 More info on this: to workaround python's nested class pickle bug we put
 any class which contain a nested class into {{{NestedMetaclass}}}. The
 main purpose of this metaclass is to change the class {{{__name__}}} with
 the help of the function
 {{{modify_for_nested_pickle}}}. As a result sphinx has the impression that
 the class is an alias. Demonstration: if I comment line 112 of
 nested_class.py
 {{{
 diff --git a/sage/misc/nested_class.py b/sage/misc/nested_class.py
 --- a/sage/misc/nested_class.py
 +++ b/sage/misc/nested_class.py
 @@ -108,7 +108,7 @@ def modify_for_nested_pickle(cls, name_p
              if v.__name__ == name and v.__module__ == module.__name__ and
 getattr(module, name, None) is not v:
                  # OK, probably this is a nested class.
                  dotted_name = name_prefix + '.' + name
 -                v.__name__ = dotted_name
 +                # v.__name__ = dotted_name
                  setattr(module, dotted_name, v)
                  modify_for_nested_pickle(v, dotted_name, module)
 }}}
 Then everything works fine. Any idea to solve this ?

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