Skip to content

Commit

Permalink
bpo-37624: Document weight assumptions for random.choices() (GH-14855) (
Browse files Browse the repository at this point in the history
GH-14858)

(cherry picked from commit 8dbe563)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
  • Loading branch information
miss-islington and rhettinger committed Jul 19, 2019
1 parent 8403524 commit a50a622
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doc/library/random.rst
Expand Up @@ -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
Expand Down

0 comments on commit a50a622

Please sign in to comment.