@@ -2951,14 +2951,19 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
2951
2951
2952
2952
return n
2953
2953
2954
- def prime_divisors (self , *, limit = None ):
2954
+ def prime_divisors (self , *args , ** kwds ):
2955
2955
"""
2956
2956
Return the prime divisors of this integer, sorted in increasing order.
2957
2957
2958
2958
If this integer is negative, we do *not* include -1 among
2959
2959
its prime divisors, since -1 is not a prime number.
2960
2960
2961
- If ``limit`` is given, only primes up to the limit are returned.
2961
+ INPUT:
2962
+
2963
+ - ``limit`` -- (integer, optional keyword argument)
2964
+ Return only prime divisors up to this bound.
2965
+
2966
+ Any additional arguments are passed on to the :meth:`factor` method.
2962
2967
2963
2968
EXAMPLES::
2964
2969
@@ -2971,7 +2976,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
2971
2976
sage: a = 2004; a.prime_divisors()
2972
2977
[2, 3, 167]
2973
2978
2974
- ::
2979
+ Setting the optional ``limit`` argument works as expected ::
2975
2980
2976
2981
sage: a = 10^100 + 1
2977
2982
sage: a.prime_divisors()
@@ -2982,7 +2987,8 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
2982
2987
sage: a.prime_divisors(limit=10^7)
2983
2988
[73, 137, 401, 1201, 1601, 1676321]
2984
2989
"""
2985
- res = [r[0 ] for r in self .factor(limit = limit)]
2990
+ res = [r[0 ] for r in self .factor(* args, ** kwds)]
2991
+ limit = kwds.get(' limit' )
2986
2992
if limit is not None :
2987
2993
res = [r for r in res if r <= limit]
2988
2994
return res
0 commit comments