summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-09-27 04:45:57 (GMT)
committerRaymond Hettinger <python@rcn.com>2016-09-27 04:45:57 (GMT)
commit9016f2864affea83d4d2c02f4396823f8a56b394 (patch)
treebd12f48eed87079bd24d43bace81be5c46c7af21 /Lib/random.py
parent22805ca54e1e5db4b66be1b28b0baac2b1b4b4de (diff)
downloadcpython-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.py2
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,