fplll / fpylll

A Python interface for https://github.com/fplll/fplll
GNU General Public License v2.0
118 stars 60 forks source link

Incompatibility with Python 3.12 #246

Closed encukou closed 10 months ago

encukou commented 1 year ago

Python 3.12 changes the internal representation of int objects (to speed up common cases). Usage of Py_SIZE and ob_digit in gmp/pylong.pyx will fail.

The supported way of extracting the value of integers (if they don't fit in a C long long) is the Python method to_bytes, and there's from_bytes to go back. (If this is too slow for fpylll, please chime in in the discussion.)

(edit) See also: https://github.com/python/cpython/pull/101292

malb commented 1 year ago

Thank you for flagging this! I don't think we need every last drop of performance here. I anyone would prepare a PR, that'd be fab :)

malb commented 1 year ago

See https://github.com/sagemath/sage/pull/36181