#17228: Implement CachedMethodCaller.precompute
-------------------------+-------------------------------------------------
Reporter: cheuberg | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.4
Component: misc | Keywords: cached_method, precompute,
Merged in: | parallel
Reviewers: | Authors: Clemens Heuberger
Work issues: | Report Upstream: N/A
Commit: | Branch:
Stopgaps: | Dependencies:
-------------------------+-------------------------------------------------
Currently, `CachedMethodCaller` inherits the method `precompute` from
`CachedFunction`, but it does not work as expected:
{{{
sage: class Foo(object):
....: @cached_method
....: def f(self, i):
....: return i^2
sage: foo = Foo()
sage: foo.f.precompute(range(2))
f() takes exactly 2 arguments (1 given)
f() takes exactly 2 arguments (1 given)
sage: foo.f.cache
{((0,), ()): 'NO DATA', ((1,), ()): 'NO DATA'}
}}}
It seems that it can be fixed by copying the `precompute` method and
replacing `self.f` by `self._instance_call`.
--
Ticket URL: <http://trac.sagemath.org/ticket/17228>
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.