For "lossless" conversion to gmpy2 library types such as mpq I am forced to use mpf(...)._mpf_ attribute, which is private. Calling libmp.to_rational returns the TypeError: 'mpf' object is not iterable. Shouldn't there be an "official" way to convert mpf() to gmpy2 numerals, expecially because mpmath itself relies on that library internally?
For "lossless" conversion to gmpy2 library types such as mpq I am forced to use
mpf(...)._mpf_attribute, which is private. Calling libmp.to_rational returns the TypeError: 'mpf' object is not iterable. Shouldn't there be an "official" way to convert mpf() to gmpy2 numerals, expecially because mpmath itself relies on that library internally?