#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:85 jsrn]:
 > Ok, this might be nitpicking, but I'm not completely happy with your
 hack in lines 731-740: first off, the following function definition, I
 think, would cause the code to fail:
 >
 > {{{
 > def monkey2(a={(1+2) : 'wee'}):
 >    return a[3]
 > }}}

 VoilĂ .

 {{{
 sage: def monkey2(a={(1+2) : 'wee'}):
 ....:        return a[3]
 ....:
 sage: sage.misc.sageinspect.sage_getargspec(monkey2)
 ArgSpec(args=['a'], varargs=None, keywords=None, defaults=({3: 'wee'},))
 }}}

 > and in general, there's no way to avoid that with your approach, as you
 can't match nested parentheses with regular expressions.

 By the way, it wasn't my trick. I copied it from the corresponding lines
 of _sage_getargspec_cython.

 > Ok, moving back to realism, is this then really what we want? I mean, if
 a decorator is so insightful so as to save the wrapped function's src in
 its own _sage_src_, but does not save its argspec in _sage_argspec_,
 aren't we asking for errors?

 In the near future (#11115) the cached method decorators will have
 _sage_argspec_.

 > Of course, we could also retain this fix until such time as the
 cached_method is fixed, and ticket #11115 could have the removal of this
 code in its ticket. Was this what you had in mind all along?

 Somehow.

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