Open
Description
Currently, PyCall uses strings as the interchange mechanism for BigFloat
and BigInt
. This is suboptimal from a performance perspective and also potentially lossy in the case of BigFloat
.
However, the gmpy2
module for Python provides a Python interface to GNU MP/MPFR numbers (the same as Julia), and it should be possible (with suitable digging) to pass Julia bignums to Python in binary form (and potentially without making a copy). (Furthermore, when the gmpy2
module is available in Python, the mpmath
module automatically uses it anyway, so we might as well take advantage of it for BigFloat
conversions if it is present.)
I'm not sure if anyone actually cares about better bignum interoperability with Python, though?