# HG changeset patch
# User KarlDieter Crisman
# 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/sage/rings/arith.py Wed Feb 16 11:49:17 2011 +0800
+++ b/sage/rings/arith.py Sat Mar 12 21:30:30 2011 0500
@@ 857,9 +857,10 @@
## return P + X
def primes(start, stop=None, proof=None):
 r""" Returns an iterator over all primes between start and stop1,
+ r"""
+ Returns an iterator over all primes between start and stop1,
inclusive. This is much slower than ``prime_range``, but
 potentially uses less memory. As with ``next_prime``, the optional
+ potentially uses less memory. As with :func:`next_prime`, the optional
argument proof controls whether the numbers returned are
guaranteed to be prime or not.
@@ 867,28 +868,25 @@
over primes. In some cases it is better to use primes than
``prime_range``, because primes does not build a list of all primes in
the range in memory all at once. However, it is potentially much
 slower since it simply calls the ``next_prime`` function
 repeatedly, and ``next_prime`` is slow.

 INPUT:

+ slower since it simply calls the :func:`next_prime` function
+ repeatedly, and :func:`next_prime` is slow.
+
+ INPUT:
  ``start``  an integer
 lower bound for the primes

  ``stop``  an integer (or infinity)
 upper (open) bound for the primes

  ``proof``  bool or None (default: None) If True, the function
 yields only proven primes. If False, the function uses a
 pseudoprimality test, which is much faster for really big
 numbers but does not provide a proof of primality. If None,
 uses the global default (see :mod:`sage.structure.proof.proof`)


 OUTPUT:

  an iterator over primes from start to stop1, inclusive
+  ``start``  an integer  lower bound for the primes
+
+  ``stop``  an integer (or infinity) optional argument 
+ giving upper (open) bound for the primes
+
+  ``proof``  bool or None (default: None) If True, the function
+ yields only proven primes. If False, the function uses a
+ pseudoprimality test, which is much faster for really big
+ numbers but does not provide a proof of primality. If None,
+ uses the global default (see :mod:`sage.structure.proof.proof`)
+
+ OUTPUT:
+
+  an iterator over primes from start to stop1, inclusive
EXAMPLES::
@@ 924,7 +922,8 @@
13
17
19

+ sage: next(p for p in primes(10,oo)) # checks alternate infinity notation
+ 11
"""
from sage.rings.infinity import infinity