#9976: Decorated functions/methods have generic signature in documentation
--------------------------------+-------------------------------------------
   Reporter:  jsrn              |       Owner:  jsrn                            
        
       Type:  enhancement       |      Status:  needs_review                    
        
   Priority:  major             |   Milestone:  sage-4.7                        
        
  Component:  documentation     |    Keywords:  sphinx, documentation, cython 
inspection
     Author:  jsrn, Simon King  |    Upstream:  N/A                             
        
   Reviewer:                    |      Merged:                                  
        
Work_issues:                    |  
--------------------------------+-------------------------------------------

Comment(by SimonKing):

 Replying to [comment:90 SimonKing]:
 > By the way, it wasn't my trick. I copied it from the corresponding lines
 of _sage_getargspec_cython.

 Regarding the regular expression used:

 The regular expression just extracts the line of code in which the
 function's arguments are defined (or cdefined, if it is Cython). Then,
 that definition is turned into a dummy Python function (even if it was
 Cython code). And _sage_argspec_from_ast knows how to deal with that case.

 In particular, the regular expression is ''not'' used to extract the
 arguments directly! That would indeed be difficult.

 By the way, providing typed arguments in Cython works as well:
 {{{
 sage: cython("cpdef int foo(bint x, int y=5) except -1: return 1")
 sage: sage.misc.sageinspect.sage_getargspec(foo)
 ArgSpec(args=['x', 'y'], varargs=None, keywords=None, defaults=(5,))
 }}}

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