[Python-Dev] [Python-checkins] cpython (2.7): Issue 10787: Document the probability density function for random.gammavariate.

Daniel Stutzbach stutzbach at google.com
Wed Mar 23 00:08:52 CET 2011


Raymond,

The Doc/reference/datamodel.rst change appears unrelated and wasn't in the
3.x version of this commit.  Was the change intentional?

On Tue, Mar 22, 2011 at 3:52 PM, raymond.hettinger <
python-checkins at python.org> wrote:

> http://hg.python.org/cpython/rev/42816be02b9b
> changeset:   68845:42816be02b9b
> branch:      2.7
> parent:      68841:50cc60852a76
> user:        Raymond Hettinger <python at rcn.com>
> date:        Tue Mar 22 15:52:46 2011 -0700
> summary:
>  Issue 10787: Document the probability density function for
> random.gammavariate.
>
> files:
>  Doc/reference/datamodel.rst
>  Lib/random.py
>
> diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
> --- a/Doc/reference/datamodel.rst
> +++ b/Doc/reference/datamodel.rst
> @@ -1540,10 +1540,10 @@
>
>  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)
> diff --git a/Lib/random.py b/Lib/random.py
> --- a/Lib/random.py
> +++ b/Lib/random.py
> @@ -490,6 +490,12 @@
>
>         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
>
> --
> Repository URL: http://hg.python.org/cpython
>
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>
>


-- 
Daniel Stutzbach
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20110322/6d39f3ee/attachment.html>


More information about the Python-Dev mailing list