#17814: Make calling a cached method independent of source code inspection
-------------------------------------+-------------------------------------
       Reporter:  SimonKing          |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.6
      Component:  distribution       |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Simon King         |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  
u/SimonKing/make_calling_a_cached_method_independent_of_source_code_inspection| 
 30543e7b283c52cad2fbeb060efe78a74c7b42ba
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 Replying to [comment:33 nbruin]:
 > Replying to [comment:32 jdemeyer]:
 > > Personally, I still think that [comment:15] is the best solution (but
 I'm still open to other suggestions).
 >
 > This information is cheaply available when cython does its work, We
 could ask the cython devs if they would be willing to equip their function
 objects with attributes that play the role of `__code__.co_argcount`,
 `__code__.co_flags` (to see if `*args` or `**kwds` is present),
 `__code__.varnames`, `func_defaults`.

 If I recall correctly, there is a compile option to do so.

 In any case, I believe that for now we should proceed as follows:
 - Avoid source code inspection in the cached method's `__get__` (as done
 by the currently attached branch)
 - When creating the `ArgumentFixer`, we need to know the argspec. If it
 can not be determined, then no error should be raised. Instead, a generic
 argument fixer (or no argument fixer at all) shall be used, meaning that
 the argspec is assumed to be formed by `self`, `*args` and `**kwds`. This
 I can implement shortly, as soon as I have reinstalled ccache on my
 current Sage version (now it takes hours to switch branches `:-/`).
 - In the long run, ask the cython devs to provide functions that can
 access the relevant information.

--
Ticket URL: <http://trac.sagemath.org/ticket/17814#comment:34>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to