python-flint icon indicating copy to clipboard operation
python-flint copied to clipboard

More efficient conversion from Python int to fmpz

Open oscarbenjamin opened this issue 1 year ago • 1 comments

It looks like Python 3.13 will provide public C API for efficiently converting to and from a PyLong. These should be compatible with mpz_import/mpz_export rather than converting between hex strings:

https://github.com/python/cpython/pull/121339

https://github.com/flintlib/python-flint/blob/430b8e50f4d8e697d4f5c7666d7b75f3e440a260/src/flint/types/fmpz.pxd#L15-L23 https://github.com/flintlib/python-flint/blob/430b8e50f4d8e697d4f5c7666d7b75f3e440a260/src/flint/types/fmpz.pyx#L16-L27

oscarbenjamin avatar Jul 04 '24 11:07 oscarbenjamin