diff --git a/README.md b/README.md index d808ae21..c03c8558 100644 --- a/README.md +++ b/README.md @@ -144,12 +144,16 @@ Compatible versions: | python-flint | Release date | CPython | FLINT | Cython | |--------------|---------------|-------------|------------|------------------| +| `0.9.0` | ??? | `3.11-3.14` | `3.0-3.3` | `3.1-3.2?` | | `0.8.0` | 29th Aug 2025 | `3.11-3.14` | `3.0-3.3` | `3.1` only | | `0.7.0` | 16th Mar 2025 | `3.11-3.13` | `3.0-3.2` | `3.0.11-3.1.0a1` | | `0.6.0` | 1st Feb 2024 | `3.9-3.12` | `3.0` only | `3.0` only | The requirement for Cython 3.1 is only for CPython's free-threaded build. -Otherwise Cython 3.0 is fine. As of python-flint 0.7.0, CPython 3.13 [PEP +Otherwise Cython 3.0 is fine. Cython 3.2 is required for a stable ABI build of +python-flint. + +As of python-flint 0.7.0, CPython 3.13 [PEP 703](https://peps.python.org/pep-0703/) free-threaded (no-GIL) builds of python-flint are provided. In the the free-threaded build, mutating matrices or polynomials from multiple threads can lead to memory corruption. There are some diff --git a/meson.build b/meson.build index a8922502..16860da3 100644 --- a/meson.build +++ b/meson.build @@ -15,7 +15,7 @@ project( flint_lower = '>=3.0' flint_upper = '<3.4' cython_lower = '>=3.0.11' -cython_upper = '<3.2' +cython_upper = '<3.3' py = import('python').find_installation(pure: false) dep_py = py.dependency() diff --git a/pyproject.toml b/pyproject.toml index baf16eb6..05aa589c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ content-type = "text/markdown" # fine. It is not possible to have a separate version constraint here for the # freethreading build only though. # -requires = ["meson-python >= 0.18", "cython >=3.1,<3.2"] +requires = ["meson-python >= 0.18", "cython >=3.1,<3.3"] build-backend = "mesonpy" [tool.meson-python] diff --git a/src/flint/types/_gr.pyx b/src/flint/types/_gr.pyx index 1c8c590b..a555f367 100644 --- a/src/flint/types/_gr.pyx +++ b/src/flint/types/_gr.pyx @@ -602,11 +602,11 @@ cdef class gr_ctx(flint_ctx): ### # Square Roots - def is_square(self, x): + def is_square(self, x) -> bool | None: """ Returns whether x is a perfect square in the context. """ - return self._is_square(self(x)) + return truth_to_py(self._is_square(self(x))) def sqrt(self, x) -> gr: """ @@ -1912,7 +1912,7 @@ cdef class gr(flint_scalar): >>> Q(4).sqrt() 2 """ - return truth_to_py(self.ctx.is_square(self)) + return self.ctx.is_square(self) def sqrt(self): """Return the square root of the element if it exists.