BUG/DOC: Trig Functions "cannot create mpf from..." depending on namespace #9045
Open
Description
I'm brand new to sympy, but either I found a bug (doubt it), or the docs need updating (more likely).
This works:
>>> from sympy import symbols, cos
>>> x = symbols('x')
>>> cos(x)
cos(x)
But, as mentioned in the latest docs:
>>> from sympy.mpmath import cos
>>> x = symbols('x')
>>> cos(x)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\WinPython-32bit-2.7.9.2-20150202\python-2.7.9\lib\site-packages\sympy\mpmath\ctx_mp_python.py", line 984, in f
x = ctx.convert(x)
File "C:\WinPython-32bit-2.7.9.2-20150202\python-2.7.9\lib\site-packages\sympy\mpmath\ctx_mp_python.py", line 662, in convert
return ctx._convert_fallback(x, strings)
File "C:\WinPython-32bit-2.7.9.2-20150202\python-2.7.9\lib\site-packages\sympy\mpmath\ctx_mp.py", line 614, in _convert_fallback
raise TypeError("cannot create mpf from " + repr(x))
TypeError: cannot create mpf from x
I can likely find time to do a PR, assuming it's just doc strings's import statements, in mpmath\ctx_mp.py that need tweaking.
Activity