Even using mpmath 1.2.1 when inside sage. The mpf class is not defined.
For example:
sage: import mpmath
sage: mpmath.ctx_mp_python.mpf
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-8e8eed115623> in <module>
----> 1 mpmath.ctx_mp_python.mpf
AttributeError: module 'mpmath.ctx_mp_python' has no attribute 'mpf'
And if you look at mpmath/libmp/libmpf.py you will see lines like:
if BACKEND == 'sage':
Some of this I guess has to do with differences in Python pickle between Pythoin 2 and Python3. But if that is so, then wouldn't a test on the Python version be more direct?
And why is the mpf class missing in this case?