Skip to content

Commit f34e228

Browse files
author
Jake Moss
committed
Replace back ticks with quotes in exception strings
1 parent b2d2694 commit f34e228

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

src/flint/flint_base/flint_base.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,14 @@ cdef class flint_mpoly_context(flint_elem):
347347
# A type hint of ``ordering: Ordering`` results in the error "TypeError: an integer is required" if a Ordering
348348
# object is not provided. This is pretty obtuse so we check its type ourselves
349349
if not isinstance(ordering, Ordering):
350-
raise TypeError(f"``ordering`` ('{ordering}') is not an instance of flint.Ordering")
350+
raise TypeError(f"'ordering' ('{ordering}') is not an instance of flint.Ordering")
351351

352352
if nametup is not None:
353353
key = nvars, ordering, nametup
354354
elif nametup is None and names is not None:
355355
key = nvars, ordering, cls.create_variable_names(nvars, names)
356356
else:
357-
raise ValueError("must provide either ``names`` or ``nametup``")
357+
raise ValueError("must provide either 'names' or 'nametup'")
358358
return key
359359

360360
@classmethod
@@ -854,7 +854,7 @@ cdef class flint_mat(flint_elem):
854854

855855
cdef ordering_t ordering_py_to_c(ordering): # Cython does not like an "Ordering" type hint here
856856
if not isinstance(ordering, Ordering):
857-
raise TypeError(f"`ordering` ('{ordering}') is not an instance of flint.Ordering")
857+
raise TypeError(f"'ordering' ('{ordering}') is not an instance of flint.Ordering")
858858

859859
if ordering == Ordering.lex:
860860
return ordering_t.ORD_LEX

src/flint/types/fmpz_mod.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ cdef class fmpz_mod(flint_scalar):
246246
self.ctx = ctx
247247
check = self.ctx.set_any_as_fmpz_mod(self.val, val)
248248
if check is NotImplemented:
249-
raise NotImplementedError(f"Cannot convert {val} to type `fmpz_mod`")
249+
raise NotImplementedError(f"Cannot convert {val} to type 'fmpz_mod'")
250250

251251
def is_zero(self):
252252
"""

src/flint/types/fmpz_mod_mpoly.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ cdef class fmpz_mod_mpoly_ctx(flint_mpoly_context):
117117
# A type hint of ``ordering: Ordering`` results in the error "TypeError: an integer is required" if a Ordering
118118
# object is not provided. This is pretty obtuse so we check its type ourselves
119119
if not isinstance(ordering, Ordering):
120-
raise TypeError(f"`ordering` ('{ordering}') is not an instance of flint.Ordering")
120+
raise TypeError(f"'ordering' ('{ordering}') is not an instance of flint.Ordering")
121121
elif not typecheck(modulus, fmpz):
122122
m = any_as_fmpz(modulus)
123123
if m is NotImplemented:
124-
raise TypeError(f"`modulus` ('{modulus}') is not coercible to fmpz")
124+
raise TypeError(f"'modulus' ('{modulus}') is not coercible to fmpz")
125125
else:
126126
modulus = m
127127

@@ -130,7 +130,7 @@ cdef class fmpz_mod_mpoly_ctx(flint_mpoly_context):
130130
elif nametup is None and names is not None:
131131
key = nvars, ordering, cls.create_variable_names(nvars, names), modulus
132132
else:
133-
raise ValueError("must provide either `names` or `nametup`")
133+
raise ValueError("must provide either 'names' or 'nametup'")
134134
return key
135135

136136
def any_as_scalar(self, other):

src/flint/types/fmpz_mod_poly.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ cdef class fmpz_mod_poly_ctx:
130130
"""
131131
cdef slong length
132132
if not (isinstance(monic, bool) and isinstance(irreducible, bool)):
133-
raise ValueError("Both `monic` and `irreducible` must be of type bool")
133+
raise ValueError("Both 'monic' and 'irreducible' must be of type bool")
134134

135135
length = degree + 1
136136
if length <= 0:
@@ -292,7 +292,7 @@ cdef class fmpz_mod_poly_ctx:
292292
for i in range(n):
293293
check = self.mod.set_any_as_fmpz_mod(&xs.val[i], vals[i])
294294
if check is NotImplemented:
295-
raise ValueError(f"Unable to cast {vals[i]} to an `fmpz_mod`")
295+
raise ValueError(f"Unable to cast {vals[i]} to an 'fmpz_mod'")
296296

297297
res = self.new_ctype_poly()
298298
fmpz_mod_poly_minpoly(res.val, xs.val, n, self.mod.val)
@@ -482,7 +482,7 @@ cdef class fmpz_mod_poly(flint_poly):
482482
# Case when right is not fmpz_mod_poly, try to convert to fmpz
483483
right = self.ctx.any_as_fmpz_mod_poly(right)
484484
if right is NotImplemented:
485-
raise TypeError(f"Cannot convert {right} to `fmpz_mod_poly` type.")
485+
raise TypeError(f"Cannot convert {right} to 'fmpz_mod_poly' type.")
486486

487487
if right == 0:
488488
raise ZeroDivisionError("Cannot divide by zero")
@@ -765,7 +765,7 @@ cdef class fmpz_mod_poly(flint_poly):
765765
for i in range(n):
766766
check = self.ctx.mod.set_any_as_fmpz_mod(&xs.val[i], vals[i])
767767
if check is NotImplemented:
768-
raise ValueError(f"Unable to cast {vals[i]} to an `fmpz_mod`")
768+
raise ValueError(f"Unable to cast {vals[i]} to an 'fmpz_mod'")
769769

770770
# Call for multipoint eval, iterative horner will be used
771771
# for small arrays (len < 32) and a fast eval for larger ones

src/flint/types/fq_default_poly.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ cdef class fq_default_poly_ctx:
188188
"""
189189
cdef slong length
190190
if not (isinstance(monic, bool) and isinstance(irreducible, bool) and isinstance(not_zero, bool)):
191-
raise TypeError("All of `not_zero`, `monic` and `irreducible` must be of type bool")
191+
raise TypeError("All of 'not_zero', 'monic' and 'irreducible' must be of type bool")
192192

193193
length = degree + 1
194194
if length <= 0:
@@ -748,7 +748,7 @@ cdef class fq_default_poly(flint_poly):
748748
# Case when right is not fq_default_poly, try to convert to fmpz
749749
other = self.ctx.any_as_fq_default_poly(other)
750750
if other is NotImplemented:
751-
raise TypeError(f"Cannot convert {other} to `fq_default_poly` type.")
751+
raise TypeError(f"Cannot convert {other} to 'fq_default_poly' type.")
752752

753753
if other.is_zero():
754754
raise ZeroDivisionError("Cannot divide by zero")

src/flint/types/nmod_mpoly.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ cdef class nmod_mpoly_ctx(flint_mpoly_context):
116116
# A type hint of ``ordering: Ordering`` results in the error "TypeError: an integer is required" if a Ordering
117117
# object is not provided. This is pretty obtuse so we check its type ourselves
118118
if not isinstance(ordering, Ordering):
119-
raise TypeError(f"`ordering` ('{ordering}') is not an instance of flint.Ordering")
119+
raise TypeError(f"'ordering' ('{ordering}') is not an instance of flint.Ordering")
120120

121121
if nametup is not None:
122122
key = nvars, ordering, nametup, modulus
123123
elif nametup is None and names is not None:
124124
key = nvars, ordering, cls.create_variable_names(nvars, names), modulus
125125
else:
126-
raise ValueError("must provide either `names` or `nametup`")
126+
raise ValueError("must provide either 'names' or 'nametup'")
127127
return key
128128

129129
def any_as_scalar(self, other):

0 commit comments

Comments
 (0)