]> granicus.if.org Git - python/commitdiff
bpo-37624: Document weight assumptions for random.choices() (GH-14855) (GH-14858)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 19 Jul 2019 09:17:21 +0000 (02:17 -0700)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>
Fri, 19 Jul 2019 09:17:21 +0000 (02:17 -0700)
(cherry picked from commit 8dbe563aa6bd18b8c581951537dfb406d36e8063)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
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