Skip to content

Commit 8dbe563

Browse files
authored
bpo-37624: Document weight assumptions for random.choices() (GH-14855)
1 parent d395209 commit 8dbe563

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/library/random.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ Functions for sequences
160160

161161
The *weights* or *cum_weights* can use any numeric type that interoperates
162162
with the :class:`float` values returned by :func:`random` (that includes
163-
integers, floats, and fractions but excludes decimals).
163+
integers, floats, and fractions but excludes decimals). Weights are
164+
assumed to be non-negative.
164165

165166
For a given seed, the :func:`choices` function with equal weighting
166167
typically produces a different sequence than repeated calls to

0 commit comments

Comments
 (0)