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

Comment(by SimonKing):

 After preparing a lecture, I can now do some programming.

 I find:
 {{{
 sage: sage.combinat.partition_algebra.SetPartitionsAk
 <functools.partial object at 0x432d1b0>
 sage: inspect.getargspec(sage.combinat.partition_algebra.SetPartitionsAk)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /mnt/local/king/SAGE/sage-4.7.alpha5/devel/sage-main/<ipython console> in
 <module>()

 /mnt/local/king/SAGE/sage-4.7.alpha5/local/lib/python/inspect.pyc in
 getargspec(func)
     801         func = func.im_func
     802     if not isfunction(func):
 --> 803         raise TypeError('arg is not a Python function')
     804     args, varargs, varkw = getargs(func.func_code)
     805     return ArgSpec(args, varargs, varkw, func.func_defaults)
 sage: sage.combinat.partition_algebra.SetPartitionsAk.args
 ('A',)
 sage: sage.combinat.partition_algebra.SetPartitionsAk.keywords
 }}}

 Hence, even though `inspect` can not deal with `functools` (even though it
 is standard Python), it should be absolutely straight forward to extend
 `sage_getargspec` to that case.

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