Ask Your Question

Revision history [back]

The main issue seems indeed that coercion is not well defined with sympy objects. Symbolics is handled by Sage with giacpy, and not sympy, this latter is not even imported at startup, which might explain the lack of integration of sympy within Sage. There have been some discussions to make sympy (or even csympy) the handler of symbolics in Sage, but it is not the case.

The coercion enters the game because 8 is a Sage integer, not a Python int. If you want to avoid that you can turn off preparsing, by doing:

sage: preparser(False)

Alternatively, you can tell Sage that 8 is a python int, in one of the following ways:

sage: 8r*I*x
sage: int(8)*I*x