#13656: cached functions cannot be used as evalf
----------------------+-----------------------------------------------------
Reporter: tkluck | Owner: jason
Type: defect | Status: new
Priority: minor | Milestone: sage-5.5
Component: misc | Keywords:
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
----------------------+-----------------------------------------------------
An error occurs when trying to use a cached function as the `evalf_func`
argument to function. The error seems to be that some part of sage assumes
that it can compute a hash value using `evalf_func`'s `func_code`
attribute, which a cached function object doesn't have.
{{{
sage: def evalf(self, x, parent=complex):
....: return 20
....:
sage: f = function('f', evalf_func=evalf)
sage: @cached_function
....: def evalg(self, x, parent=complex):
....: return 30
....:
sage: g = function('g', evalf_func=evalg)
Exception AttributeError: "'sage.misc.cachefunc.CachedFunction' object has
no attribute 'func_code'" in
'sage.symbolic.function.SymbolicFunction._hash_' ignored
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13656>
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].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.