#8949: symbolic functions dont work with numpy.int32
-------------------------+--------------------------------------------------
Reporter: whuss | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone: sage-5.0
Component: symbolics | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-------------------------+--------------------------------------------------
{{{
sage: import numpy
sage: a = numpy.array([1,2])
sage: type(a[0])
<type 'numpy.int32'>
sage: f(x) = x^2
sage: f(a[0])
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
./sage-4.4.2/<ipython console> in <module>()
./sage-4.4.2/local/lib/python2.6/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression.__call__
(sage/symbolic/expression.cpp:15476)()
./sage-4.4.2/local/lib/python2.6/site-packages/sage/symbolic/callable.pyc
in _call_element_(self, _the_element, *args, **kwds)
454 d = dict(zip(map(repr, self.arguments()), args))
455 d.update(kwds)
--> 456 return SR(_the_element.substitute(**d))
457
458
./sage-4.4.2/local/lib/python2.6/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression.substitute
(sage/symbolic/expression.cpp:14850)()
./sage-4.4.2/local/lib/python2.6/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression.coerce_in
(sage/symbolic/expression.cpp:10193)()
./sage-4.4.2/local/lib/python2.6/site-
packages/sage/structure/parent_old.so in
sage.structure.parent_old.Parent._coerce_
(sage/structure/parent_old.c:3288)()
./sage-4.4.2/local/lib/python2.6/site-packages/sage/structure/parent.so in
sage.structure.parent.Parent.coerce (sage/structure/parent.c:6970)()
TypeError: no canonical coercion from <type 'numpy.int32'> to Callable
function ring with arguments (x,)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8949>
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.