#11115: Rewrite cached_method in Cython
-----------------------------------------------------+----------------------
   Reporter:  SimonKing                              |          Owner:  jason   
                 
       Type:  enhancement                            |         Status:  
needs_info               
   Priority:  major                                  |      Milestone:  
sage-4.7.2               
  Component:  misc                                   |       Keywords:  
category cython cache    
Work_issues:                                         |       Upstream:  N/A     
                 
   Reviewer:  Nicolas M. ThiƩry, Andrey Novoseltsev  |         Author:  Simon 
King               
     Merged:                                         |   Dependencies:  #9976 
#11298 #11342 #9138
-----------------------------------------------------+----------------------

Comment(by SimonKing):

 The problem with the wrong source file directory reminded me another
 ticket, namely #11791.

 When I start with sage-4.7.2.alpha3-prerelease and add
 #11768+#11791+#11115, I get the following:
 {{{
 sage: cython_code = ['cpdef test_meth(self,x):',
 ....:     ... '    "some doc for a wrapped cython method"',
 ....:     ... '    return -x',
 ....:     ... 'from sage.all import cached_method',
 ....:     ... 'from sage.structure.parent cimport Parent',
 ....:     ... 'cdef class MyClass(Parent):',
 ....:     ... '    wrapped_method =
 cached_method(test_meth,name="wrapped_method")']
 sage: cython('\n'.join(cython_code))
 sage: O = MyClass()
 sage: from sage.misc.sageinspect import sage_getfile, sage_getdoc
 sage: sage_getfile(O.wrapped_method)
 
'/mnt/local/king/.sage/temp/mpc622/8600//spyx/_mnt_local_king__sage_temp_mpc622_8600_tmp_0_spyx/_mnt_local_king__sage_temp_mpc622_8600_tmp_0_spyx_0.pyx'
 sage: print sage_getdoc(O.wrapped_method)
 File: _mnt_local_king__sage_temp_mpc622_8600_tmp_0_spyx_0.pyx
 (starting at line 6) some doc for a wrapped cython method
 }}}

 Note that on my machine I do not need #11791 for avoiding the doctest
 error. But perhaps #11791 solves the problem for you?

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