Skip to content

Commit 6e64bbf

Browse files
authored
Merge pull request #150 from fchapoton/cylint-gen.pyx
fixes in gen.pyx suggested by cython-lint
2 parents dc5820c + 8d8bf70 commit 6e64bbf

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

cypari2/gen.pyx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ from __future__ import absolute_import, division, print_function
5959

6060
cimport cython
6161

62-
from cpython.object cimport (Py_EQ, Py_NE, Py_LE, Py_GE, Py_LT, Py_GT,
63-
PyTypeObject)
62+
from cpython.object cimport (Py_EQ, Py_NE, Py_LE, Py_GE, Py_LT, PyTypeObject)
6463

6564
from cysignals.memory cimport sig_free, check_malloc
6665
from cysignals.signals cimport sig_check, sig_on, sig_off, sig_block, sig_unblock
@@ -69,7 +68,7 @@ from .types cimport *
6968
from .string_utils cimport to_string, to_bytes
7069
from .paripriv cimport *
7170
from .convert cimport PyObject_AsGEN, gen_to_integer
72-
from .pari_instance cimport (prec_bits_to_words, prec_words_to_bits,
71+
from .pari_instance cimport (prec_bits_to_words,
7372
default_bitprec, get_var)
7473
from .stack cimport (new_gen, new_gens2, new_gen_noclear,
7574
clone_gen, clear_stack, reset_avma,
@@ -871,7 +870,7 @@ cdef class Gen(Gen_base):
871870
return [r1, r2]
872871

873872
def nf_get_zk(self):
874-
"""
873+
r"""
875874
Returns a vector with a `\ZZ`-basis for the ring of integers of
876875
this number field. The first element is always `1`.
877876
@@ -1074,7 +1073,7 @@ cdef class Gen(Gen_base):
10741073
return new_gen(idealmoddivisor(self.g, ideal.g))
10751074

10761075
def pr_get_p(self):
1077-
"""
1076+
r"""
10781077
Returns the prime of `\ZZ` lying below this prime ideal.
10791078
10801079
NOTE: ``self`` must be a PARI prime ideal (as returned by
@@ -1096,7 +1095,7 @@ cdef class Gen(Gen_base):
10961095
return clone_gen(pr_get_p(self.g))
10971096

10981097
def pr_get_e(self):
1099-
"""
1098+
r"""
11001099
Returns the ramification index (over `\QQ`) of this prime ideal.
11011100
11021101
NOTE: ``self`` must be a PARI prime ideal (as returned by
@@ -1123,7 +1122,7 @@ cdef class Gen(Gen_base):
11231122
return e
11241123

11251124
def pr_get_f(self):
1126-
"""
1125+
r"""
11271126
Returns the residue class degree (over `\QQ`) of this prime ideal.
11281127
11291128
NOTE: ``self`` must be a PARI prime ideal (as returned by
@@ -1372,9 +1371,9 @@ cdef class Gen(Gen_base):
13721371
# Index is not a tuple or slice, convert to integer
13731372
i = n
13741373

1375-
## there are no "out of bounds" problems
1376-
## for a polynomial or power series, so these go before
1377-
## bounds testing
1374+
# there are no "out of bounds" problems
1375+
# for a polynomial or power series, so these go before
1376+
# bounds testing
13781377
if pari_type == t_POL:
13791378
sig_on()
13801379
return new_gen(polcoeff0(self.g, i, -1))
@@ -1515,7 +1514,7 @@ cdef class Gen(Gen_base):
15151514
>>> type(v[0])
15161515
<... 'cypari2.gen.Gen'>
15171516
"""
1518-
cdef Py_ssize_t i, j, step
1517+
cdef Py_ssize_t i, j
15191518
cdef Gen x = objtogen(y)
15201519

15211520
if isinstance(n, tuple):
@@ -3448,7 +3447,7 @@ cdef class Gen(Gen_base):
34483447
return new_gens2(x, y)
34493448

34503449
def elltors(self):
3451-
"""
3450+
r"""
34523451
Return information about the torsion subgroup of the given
34533452
elliptic curve.
34543453
@@ -3695,7 +3694,7 @@ cdef class Gen(Gen_base):
36953694
return v
36963695

36973696
def nfbasis(self, long flag=0, fa=None):
3698-
"""
3697+
r"""
36993698
Integral basis of the field `\QQ[a]`, where ``a`` is a root of
37003699
the polynomial x.
37013700
@@ -4160,7 +4159,7 @@ cdef class Gen(Gen_base):
41604159
3
41614160
"""
41624161
if typ(self.g) != t_CLOSURE:
4163-
raise TypeError(f"arity() requires a t_CLOSURE")
4162+
raise TypeError("arity() requires a t_CLOSURE")
41644163
return closure_arity(self.g)
41654164

41664165
def factorpadic(self, p, long r=20):

0 commit comments

Comments
 (0)