#16337: key parameter of cached_method is not correctly propagated
-------------------------------------------+----------------------------
       Reporter:  saraedum                 |        Owner:
           Type:  defect                   |       Status:  needs_review
       Priority:  minor                    |    Milestone:  sage-6.3
      Component:  misc                     |   Resolution:
       Keywords:                           |    Merged in:
        Authors:  Julian Rueth             |    Reviewers:
Report Upstream:  N/A                      |  Work issues:
         Branch:  u/saraedum/ticket/16337  |       Commit:
   Dependencies:                           |     Stopgaps:
-------------------------------------------+----------------------------
Changes (by {'newvalue': u'Julian Rueth', 'oldvalue': ''}):

 * status:  new => needs_review
 * author:   => Julian Rueth


Old description:

> In the following example, the last line is incorrect:
> {{{
> sage: class Foo:
> ....:     @cached_method(key=lambda self,y: y+1)
> ....:     def f(self, y):
> ....:         return y - 1
> sage: class Bar:
> ....:     f = Foo.f
>
> sage: b = Bar()
> sage: b.f(0)
> -1
> sage: b.f.cache
> {((0,), ()): -1}
> }}}
>
> It appears that I forgot to propagate the `key` parameter in some places
> while working on #15657.

New description:

 In the following example, the last line is incorrect:
 {{{
 sage: class Foo:
 ....:     @cached_method(key=lambda self,y: y+1)
 ....:     def f(self, y):
 ....:         return y - 1
 sage: class Bar:
 ....:     f = Foo.f

 sage: b = Bar()
 sage: b.f(0)
 -1
 sage: b.f.cache
 {((0,), ()): -1}
 }}}

 It appears that I forgot to propagate the `key` parameter in some places
 while working on #15657.

--

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