]> granicus.if.org Git - python/commitdiff
Issue 10787: Document the probability density function for random.gammavariate.
authorRaymond Hettinger <python@rcn.com>
Tue, 22 Mar 2011 22:52:46 +0000 (15:52 -0700)
committerRaymond Hettinger <python@rcn.com>
Tue, 22 Mar 2011 22:52:46 +0000 (15:52 -0700)
Doc/reference/datamodel.rst
Lib/random.py

index 12dc4d8e3c4addcf53697652b2514b0a2c4604eb..b7137c9a40ad30d8785cc7739ed95be19cb45b68 100644 (file)
@@ -1540,10 +1540,10 @@ Implementing Descriptors
 
 The following methods only apply when an instance of the class containing the
 method (a so-called *descriptor* class) appears in the class dictionary of
-another new-style class, known as the *owner* class. In the examples below, "the
-attribute" refers to the attribute whose name is the key of the property in the
-owner class' ``__dict__``.  Descriptors can only be implemented as new-style
-classes themselves.
+another new-style class (known as the *owner* class) or one of its
+descendants.  In the examples below, "the attribute" refers to the attribute
+whose name is the key of the property in the owner class' ``__dict__``.
+Descriptors can only be implemented as new-style classes themselves.
 
 
 .. method:: object.__get__(self, instance, owner)
index 01e1420df6d1855e743acfc3e609f97dc8343ebf..dcc79d1fffd8aee4be356556af436b32e4e9e1ae 100644 (file)
@@ -490,6 +490,12 @@ class Random(_random.Random):
 
         Conditions on the parameters are alpha > 0 and beta > 0.
 
+        The probability distribution function is:
+
+                    x ** (alpha - 1) * math.exp(-x / beta)
+          pdf(x) =  --------------------------------------
+                      math.gamma(alpha) * beta ** alpha
+
         """
 
         # alpha > 0, beta > 0, mean is alpha*beta, variance is alpha*beta**2