File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2374,7 +2374,7 @@ cdef class Gen(Gen_auto):
2374
2374
R -= 1
2375
2375
return new_gen(v)
2376
2376
2377
- def Ser (f , v = - 1 , long precision = - 1 ):
2377
+ def Ser (f , v = None , long precision = - 1 ):
2378
2378
"""
2379
2379
Return a power series or Laurent series in the variable `v`
2380
2380
constructed from the object `f`.
@@ -3755,7 +3755,7 @@ cdef class Gen(Gen_auto):
3755
3755
sig_on()
3756
3756
return new_gen(eltreltoabs(self .g, t0.g))
3757
3757
3758
- def galoissubfields (self , long flag = 0 , v = - 1 ):
3758
+ def galoissubfields (self , long flag = 0 , v = None ):
3759
3759
"""
3760
3760
List all subfields of the Galois group ``self``.
3761
3761
@@ -4298,7 +4298,7 @@ cdef class Gen(Gen_auto):
4298
4298
sig_on()
4299
4299
return new_gen(factorpadic(self .g, t0.g, r))
4300
4300
4301
- def poldegree (self , var = - 1 ):
4301
+ def poldegree (self , var = None ):
4302
4302
"""
4303
4303
Return the degree of this polynomial.
4304
4304
"""
Original file line number Diff line number Diff line change @@ -1328,7 +1328,7 @@ cdef long get_var(v) except -2:
1328
1328
Convert ``v`` into a PARI variable number.
1329
1329
1330
1330
If ``v`` is a PARI object, return the variable number of
1331
- ``variable(v)``. If ``v`` is ``None`` or ``-1`` , return -1.
1331
+ ``variable(v)``. If ``v`` is ``None``, return -1.
1332
1332
Otherwise, treat ``v`` as a string and return the number of
1333
1333
the variable named ``v``.
1334
1334
@@ -1354,6 +1354,8 @@ cdef long get_var(v) except -2:
1354
1354
2*x
1355
1355
>>> pari("[Pi,0]").Pol('!@#$%^&')
1356
1356
3.14159265358979*!@#$%^&
1357
+ >>> pari("[1,0]").Pol(-1) # Deprecated
1358
+ x
1357
1359
1358
1360
We can use ``varhigher()`` and ``varlower()`` to create
1359
1361
temporary variables without a name. The ``"xx"`` below is just a
@@ -1383,6 +1385,8 @@ cdef long get_var(v) except -2:
1383
1385
else :
1384
1386
return varno
1385
1387
if v == - 1 :
1388
+ from warnings import warn
1389
+ warn(" using '-1' as variable name is deprecated, use 'None' to mean 'no variable'" , DeprecationWarning )
1386
1390
return - 1
1387
1391
cdef bytes s = to_bytes(v)
1388
1392
sig_on()
You can’t perform that action at this time.
0 commit comments