[Python-checkins] r68378 - in python/trunk: Doc/library/random.rst Lib/random.py

mark.dickinson python-checkins at python.org
Wed Jan 7 18:48:33 CET 2009


Author: mark.dickinson
Date: Wed Jan  7 18:48:33 2009
New Revision: 68378

Log:
Issue #4869: clarify documentation for random.expovariate.


Modified:
   python/trunk/Doc/library/random.rst
   python/trunk/Lib/random.py

Modified: python/trunk/Doc/library/random.rst
==============================================================================
--- python/trunk/Doc/library/random.rst	(original)
+++ python/trunk/Doc/library/random.rst	Wed Jan  7 18:48:33 2009
@@ -210,9 +210,11 @@
 
 .. function:: expovariate(lambd)
 
-   Exponential distribution.  *lambd* is 1.0 divided by the desired mean.  (The
-   parameter would be called "lambda", but that is a reserved word in Python.)
-   Returned values range from 0 to positive infinity.
+   Exponential distribution.  *lambd* is 1.0 divided by the desired
+   mean.  It should be nonzero.  (The parameter would be called
+   "lambda", but that is a reserved word in Python.)  Returned values
+   range from 0 to positive infinity if *lambd* is positive, and from
+   negative infinity to 0 if *lambd* is negative.
 
 
 .. function:: gammavariate(alpha, beta)

Modified: python/trunk/Lib/random.py
==============================================================================
--- python/trunk/Lib/random.py	(original)
+++ python/trunk/Lib/random.py	Wed Jan  7 18:48:33 2009
@@ -413,9 +413,11 @@
     def expovariate(self, lambd):
         """Exponential distribution.
 
-        lambd is 1.0 divided by the desired mean.  (The parameter would be
-        called "lambda", but that is a reserved word in Python.)  Returned
-        values range from 0 to positive infinity.
+        lambd is 1.0 divided by the desired mean.  It should be
+        nonzero.  (The parameter would be called "lambda", but that is
+        a reserved word in Python.)  Returned values range from 0 to
+        positive infinity if lambd is positive, and from negative
+        infinity to 0 if lambd is negative.
 
         """
         # lambd: rate lambd = 1/mean


More information about the Python-checkins mailing list