File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -4021,6 +4021,23 @@ cdef class Gen(Gen_base):
4021
4021
set_gel(v, i+ 1 , pol_x(fetch_user_var(varname)))
4022
4022
return new_gen(gsubstvec(self .g, v, t0.g))
4023
4023
4024
+ def arity (self ):
4025
+ """
4026
+ Return the number of arguments of this ``t_CLOSURE``.
4027
+
4028
+ >>> from cypari2 import Pari
4029
+ >>> pari = Pari()
4030
+ >>> pari("() -> 42").arity()
4031
+ 0
4032
+ >>> pari("(x) -> x").arity()
4033
+ 1
4034
+ >>> pari("(x,y,z) -> x+y+z").arity()
4035
+ 3
4036
+ """
4037
+ if typ(self .g) != t_CLOSURE:
4038
+ raise TypeError (f" arity() requires a t_CLOSURE" )
4039
+ return closure_arity(self .g)
4040
+
4024
4041
def factorpadic (self , p , long r = 20 ):
4025
4042
"""
4026
4043
p-adic factorization of the polynomial ``pol`` to precision ``r``.
You can’t perform that action at this time.
0 commit comments