#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| 
 a0b829dc10b4ccb00b99e073de8a1c0006aa1e51
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nbruin):

 Can we perhaps instrument the caching machinery to log any cache hits that
 would have been misses if `*arg, **kwarg` would be processed into a cache
 key without transporting over keywords to positional parameters? Then we
 can see the extent of the problem.

 The main one I expect there is from cases where people specify a default
 parameter, but with the default value, and that's a serious one:
 {{{
 @cached_function
 def a(x,y=1)
   return set([x,y])
 }}}
 Then `[a(1),a(1,1)]` should contain two identical sets, but only caching
 on `*arg` and `**kwarg` would return result in two non-identical sets,
 because the second would have an implicit keyword parameter `y` rather
 than a second positional parameter.

 I think this is potentially quite a serious issue, especially because in
 sage, much caching happens with the purpose of making things unique (but
 perhaps currently never in cython applications ...)

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