#12808: Optimize ClassCallMetaClass using Cython
--------------------------------------------------+-------------------------
       Reporter:  hivert                          |         Owner:  jason       
           Type:  enhancement                     |        Status:  needs_review
       Priority:  major                           |     Milestone:  sage-5.0    
      Component:  misc                            |    Resolution:              
       Keywords:  classcall UniqueRepresentation  |   Work issues:              
Report Upstream:  N/A                             |     Reviewers:              
        Authors:  Florent Hivert                  |     Merged in:              
   Dependencies:                                  |      Stopgaps:              
--------------------------------------------------+-------------------------

Comment (by SimonKing):

 Replying to [comment:35 hivert]:
 > For the record, It is possible ! I answered on the cython-users thread.

 Indeed! It seems that changing `NestedClassMetaclass` into a cdef class
 with the help of your trick works fine.

 By the way, the `__init__` of nested classes does nothing more than
 calling `nested_pickle`, but this does nothing more than to call
 `modify_for_nested_pickle`. That should thus be simplified, and perhaps
 even cpdef'd!

 Also, when `nested_pickle` calls `modify_for_nested_pickle`, it always
 looks up `sys.modules[...]` - thus, why not store `sys.modules` in a `cdef
 dict` variable?!

 I only touched the nested classes, not `ClasscallMetaclass`, and the test
 suite isn't completed yet, but most seems to pass.

 What next? As I have pointed out, it seems more straight forward to cdef
 both `NestedClassMetaclass` and its subclass `ClasscallMetaclass`
 directly, not via an additional `ClasscallType`. How should it be
 organised?

 Variant 1: I produce a patch that does the changes in nested_class, and
 includes most of the changes from your patch (but not `ClasscallType`).
 Then I post it here, and we cross-review.

 Variant 2: I review your patch from here, and do my changes (which would
 revert your changes in the bases of `ClasscallMetaclass`) on a different
 ticket.

 What do you prefer?

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