From f647074d2dcfa771b0e376ec3b61f34c8568fd8d Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Fri, 19 Jul 2019 00:46:11 -0700 Subject: [PATCH] bpo-37624: Document weight assumptions for random.choices() --- Doc/library/random.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/random.rst b/Doc/library/random.rst index fcedba4dbc2052..90b86248e6e1c3 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -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