#14017: Determine the correct argspec for python functions defined in cython 
files
------------------------------------------------+---------------------------
       Reporter:  SimonKing                     |         Owner:  jason   
           Type:  defect                        |        Status:  new     
       Priority:  major                         |     Milestone:  sage-5.7
      Component:  misc                          |    Resolution:          
       Keywords:  introspection cython argspec  |   Work issues:          
Report Upstream:  N/A                           |     Reviewers:          
        Authors:                                |     Merged in:          
   Dependencies:                                |      Stopgaps:          
------------------------------------------------+---------------------------

Comment (by SimonKing):

 Here is another example I am currently not happy with:
 {{{
 sage: cython("""
 def test():
     return 1
 def f(x,y={test():2},**kwds):pass
 """
 )
 sage: sage_getargspec(f)
 ArgSpec(args=['x', 'y'], varargs=None, keywords='kwds', defaults=({None:
 2},))
 }}}
 Hence, the default for 'y' is given as `{None: 2}`, but in fact it should
 be `{1: 2}`.

 As much as I know, Cython does not make the default values available via
 attributes of a function, unlike Python. And even if one would try to find
 the actual value by evaluating the string `'{test():2}'` in the module's
 name space, things could go terribly wrong.

 Is someone reading this? How should we proceed in this situation?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14017#comment:6>
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].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to