Skip to content

Commit e32a6dd

Browse files
committed
refactor out where the dict is for types
1 parent 163f7cc commit e32a6dd

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/flint/types/fq_default.pyx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ from flint.types.fmpz_mod_poly cimport fmpz_mod_poly, fmpz_mod_poly_ctx
77
from flint.types.nmod_poly cimport nmod_poly
88
from flint.utils.typecheck cimport typecheck
99

10+
# Allow the type to be denoted by strings or integers
11+
FQ_TYPES = {
12+
"FQ_ZECH" : 1,
13+
"FQ_NMOD" : 2,
14+
"FQ" : 3,
15+
"NMOD" : 4,
16+
"FMPZ_MOD" : 5
17+
}
18+
1019
cdef class fq_default_ctx:
1120
r"""
1221
Context object for creating :class:`~.fq_default`.
@@ -38,14 +47,6 @@ cdef class fq_default_ctx:
3847

3948
@staticmethod
4049
def _parse_input_fq_type(fq_type):
41-
# Allow the type to be denoted by strings or integers
42-
FQ_TYPES = {
43-
"FQ_ZECH" : 1,
44-
"FQ_NMOD" : 2,
45-
"FQ" : 3,
46-
"NMOD" : 4,
47-
"FMPZ_MOD" : 5
48-
}
4950
if typecheck(fq_type, str):
5051
fq_type = FQ_TYPES.get(fq_type, None)
5152
if fq_type is None:

0 commit comments

Comments
 (0)