summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-07-19 09:17:21 (GMT)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2019-07-19 09:17:21 (GMT)
commita50a6225a06e5a83ce2a880a7eb4496043fdbb55 (patch)
tree57ee63067aac82d15928c606c34c9d0016c78039 /Doc
parent840352455dfbb6acb3b69ea88a19c01b7358e801 (diff)
downloadcpython-a50a6225a06e5a83ce2a880a7eb4496043fdbb55.zip
cpython-a50a6225a06e5a83ce2a880a7eb4496043fdbb55.tar.gz
cpython-a50a6225a06e5a83ce2a880a7eb4496043fdbb55.tar.bz2
bpo-37624: Document weight assumptions for random.choices() (GH-14855) (GH-14858)
(cherry picked from commit 8dbe563aa6bd18b8c581951537dfb406d36e8063) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Diffstat (limited to 'Doc')
-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