summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2019-07-19 08:56:42 (GMT)
committerGitHub <noreply@github.com>2019-07-19 08:56:42 (GMT)
commit8dbe563aa6bd18b8c581951537dfb406d36e8063 (patch)
tree7d2e8f1d43680a96c1ac78897d6e979fc7f84145 /Doc/library
parentd3952096537d9d2706e10af0c0596daeee6a58c9 (diff)
downloadcpython-8dbe563aa6bd18b8c581951537dfb406d36e8063.zip
cpython-8dbe563aa6bd18b8c581951537dfb406d36e8063.tar.gz
cpython-8dbe563aa6bd18b8c581951537dfb406d36e8063.tar.bz2
bpo-37624: Document weight assumptions for random.choices() (GH-14855)
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/random.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
index fcedba4..90b8624 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