Skip to content

Commit e8e716b

Browse files
Merge pull request #337 from oscarbenjamin/pr_cython32
fix: cython 3.2 compatibility
2 parents 9812323 + 0795d71 commit e8e716b

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

bin/coverage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pip uninstall -y cython
1818
pip install --pre cython # unpinned to pick up new releases in CI
1919
# pip install cython==3.1.0a1 # known working version for Python < 3.13
2020

21-
meson setup build -Dcoverage=true
21+
meson setup build -Dcoverage=true -Dflint_version_check=false
2222
spin run -- coverage run $RC -m flint.test $@
2323
coverage report $RC -m --sort=cover
2424
coverage html $RC

src/flint/flint_base/flint_base.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ cdef class flint_mpoly_context(flint_elem):
474474
fmpz_mpoly_ctx(3, '<Ordering.lex: 'lex'>', ('y', 'z', 'b'))
475475
"""
476476
nvars = self.nvars()
477-
gen_idxs = set(self.variable_to_index(i) for i in gens)
477+
gen_idxs = {self.variable_to_index(i) for i in gens}
478478

479479
if len(gens) > nvars:
480480
raise ValueError(f"expected at most {nvars} unique generators, got {len(gens)}")

src/flint/types/_gr.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ cdef class gr_ctx(flint_ctx):
602602
###
603603
# Square Roots
604604

605-
def is_square(self, x) -> bool | None:
605+
def is_square(self, x):
606606
"""
607607
Returns whether x is a perfect square in the context.
608608
"""

src/flint/typing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
Iterator,
1111
Iterable,
1212
Any,
13-
Self,
1413
Mapping,
1514
Sequence,
1615
overload,
1716
)
1817

18+
if TYPE_CHECKING:
19+
from typing import Self
20+
1921
from .flint_base.flint_base import (
2022
flint_elem,
2123
flint_scalar,

0 commit comments

Comments
 (0)