]> granicus.if.org Git - python/commitdiff
bpo-37624: Document weight assumptions for random.choices() (GH-14855)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Fri, 19 Jul 2019 08:56:42 +0000 (01:56 -0700)
committerGitHub <noreply@github.com>
Fri, 19 Jul 2019 08:56:42 +0000 (01:56 -0700)
Doc/library/random.rst

index fcedba4dbc2052c9367c13e2e842ef915a7b4d60..90b86248e6e1c3654886836998f2675fc03f571d 100644 (file)
@@ -160,7 +160,8 @@ Functions for sequences
 
    The *weights* or *cum_weights* can use any numeric type that interoperates
    with the :class:`float` values returned by :func:`random` (that includes
-   integers, floats, and fractions but excludes decimals).
+   integers, floats, and fractions but excludes decimals).  Weights are
+   assumed to be non-negative.
 
    For a given seed, the :func:`choices` function with equal weighting
    typically produces a different sequence than repeated calls to