Python 3.2.3 (default, Sep 25 2013, 19:36:10)
Type "copyright", "credits" or "license" for more information.
IPython 0.13.1.rc2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from sympy import *
In [2]: x = symbols('x')
In [3]: re(acos(re(x))).subs(x,5)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-515558ca2309> in <module>()
----> 1 re(acos(re(x))).subs(x,5)
/usr/local/lib/python3.2/dist-packages/sympy/core/cache.py in wrapper(*args, **kw_args)
91 except (KeyError, TypeError):
92 pass
---> 93 r = func(*args, **kw_args)
94 try:
95 func_cache_it_cache[k] = r
/usr/local/lib/python3.2/dist-packages/sympy/core/function.py in __new__(cls, *args, **options)
366
367 evaluate = options.get('evaluate', True)
--> 368 result = super(Function, cls).__new__(cls, *args, **options)
369 if not evaluate or not isinstance(result, cls):
370 return result
/usr/local/lib/python3.2/dist-packages/sympy/core/cache.py in wrapper(*args, **kw_args)
91 except (KeyError, TypeError):
92 pass
---> 93 r = func(*args, **kw_args)
94 try:
95 func_cache_it_cache[k] = r
/usr/local/lib/python3.2/dist-packages/sympy/core/function.py in __new__(cls, *args, **options)
196
197 if evaluate:
--> 198 evaluated = cls.eval(*args)
199 if evaluated is not None:
200 return evaluated
/usr/local/lib/python3.2/dist-packages/sympy/functions/elementary/complexes.py in eval(cls, arg)
50 if arg is S.NaN:
51 return S.NaN
---> 52 elif arg.is_real:
53 return arg
54 elif arg.is_imaginary:
/usr/local/lib/python3.2/dist-packages/sympy/core/assumptions.py in getit(self)
142 if self._assumptions is self.default_assumptions:
143 self._assumptions = self.default_assumptions.copy()
--> 144 return _ask(fact, self)
145
146 getit.func_name = as_property(fact)
/usr/local/lib/python3.2/dist-packages/sympy/core/assumptions.py in _ask(fact, obj)
185 pass
186 else:
--> 187 a = evaluate(obj)
188 if a is not None:
189 assumptions.deduce_all_facts(((fact, a),))
/usr/local/lib/python3.2/dist-packages/sympy/functions/elementary/trigonometric.py in _eval_is_real(self)
1546
1547 def _eval_is_real(self):
-> 1548 return self.args[0].is_real and (self.args[0] >= -1 and self.args[0] <= 1)
1549
1550 def _eval_rewrite_as_log(self, x):
/usr/local/lib/python3.2/dist-packages/sympy/core/relational.py in __nonzero__(self)
109
110 def __nonzero__(self):
--> 111 raise TypeError("symbolic boolean expression has no truth value.")
112
113 __bool__ = __nonzero__
TypeError: symbolic boolean expression has no truth value.
In [4]: re(acos(re(x))).subs(x,5)
Out[4]: re(acos(5))
In [5]: