Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions src/flint/types/_gr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down Expand Up @@ -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.
Expand Down
Loading