Ticket #10784: trac_10784-reviewer.patch

File trac_10784-reviewer.patch, 2.8 KB (added by kcrisman, 10 years ago)

Apply after initial patch

  • sage/rings/arith.py

    # HG changeset patch
    # User Karl-Dieter Crisman <kcrisman@gmail.com>
    # Date 1299983430 18000
    # Node ID bf39f6191fbd2dfc2e9a72f9e2307d7b9ec57ab3
    # Parent  dc85f486d67d756adc9670592da863bb1c4e2f0a
    Trac 10784 - minor doc fixes, add a doctest
    
    diff -r dc85f486d67d -r bf39f6191fbd sage/rings/arith.py
    a b  
    857857##     return P + X                                 
    858858
    859859def primes(start, stop=None, proof=None):
    860     r""" Returns an iterator over all primes between start and stop-1,
     860    r"""
     861    Returns an iterator over all primes between start and stop-1,
    861862    inclusive. This is much slower than ``prime_range``, but
    862     potentially uses less memory.  As with ``next_prime``, the optional
     863    potentially uses less memory.  As with :func:`next_prime`, the optional
    863864    argument proof controls whether the numbers returned are
    864865    guaranteed to be prime or not.
    865866
     
    867868    over primes. In some cases it is better to use primes than
    868869    ``prime_range``, because primes does not build a list of all primes in
    869870    the range in memory all at once. However, it is potentially much
    870     slower since it simply calls the ``next_prime`` function
    871     repeatedly, and ``next_prime`` is slow.
    872 
    873    INPUT:
    874 
     871    slower since it simply calls the :func:`next_prime` function
     872    repeatedly, and :func:`next_prime` is slow.
     873
     874    INPUT:
    875875       
    876     -  ``start`` - an integer
    877     lower bound for the primes
    878 
    879     -  ``stop`` - an integer (or infinity)
    880     upper (open) bound for the primes
    881 
    882     -  ``proof`` - bool or None (default: None)  If True, the function
    883        yields only proven primes.  If False, the function uses a
    884        pseudo-primality test, which is much faster for really big
    885        numbers but does not provide a proof of primality. If None,
    886        uses the global default (see :mod:`sage.structure.proof.proof`)
    887 
    888 
    889    OUTPUT:
    890 
    891    -  an iterator over primes from start to stop-1, inclusive
     876    - ``start`` - an integer - lower bound for the primes
     877
     878    - ``stop`` - an integer (or infinity) optional argument -
     879      giving upper (open) bound for the primes
     880
     881    - ``proof`` - bool or None (default: None)  If True, the function
     882      yields only proven primes.  If False, the function uses a
     883      pseudo-primality test, which is much faster for really big
     884      numbers but does not provide a proof of primality. If None,
     885      uses the global default (see :mod:`sage.structure.proof.proof`)
     886
     887    OUTPUT:
     888
     889    -  an iterator over primes from start to stop-1, inclusive
    892890   
    893891   
    894892    EXAMPLES::
     
    924922        13
    925923        17
    926924        19
    927 
     925        sage: next(p for p in primes(10,oo)) # checks alternate infinity notation
     926        11
    928927    """
    929928    from sage.rings.infinity import infinity
    930929