diff options
author | Raymond Hettinger <python@rcn.com> | 2016-09-27 04:45:57 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2016-09-27 04:45:57 (GMT) |
commit | 9016f2864affea83d4d2c02f4396823f8a56b394 (patch) | |
tree | bd12f48eed87079bd24d43bace81be5c46c7af21 /Lib/random.py | |
parent | 22805ca54e1e5db4b66be1b28b0baac2b1b4b4de (diff) | |
download | cpython-9016f2864affea83d4d2c02f4396823f8a56b394.zip cpython-9016f2864affea83d4d2c02f4396823f8a56b394.tar.gz cpython-9016f2864affea83d4d2c02f4396823f8a56b394.tar.bz2 |
Issue #18844: Make the number of selections a keyword-only argument for random.choices().
Diffstat (limited to 'Lib/random.py')
-rw-r--r-- | Lib/random.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/random.py b/Lib/random.py index cd8583f..ef8cb05 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -337,7 +337,7 @@ class Random(_random.Random): result[i] = population[j] return result - def choices(self, k, population, weights=None, *, cum_weights=None): + def choices(self, population, weights=None, *, cum_weights=None, k=1): """Return a k sized list of population elements chosen with replacement. If the relative weights or cumulative weights are not specified, |