summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-09-07 07:08:44 (GMT)
committerRaymond Hettinger <python@rcn.com>2016-09-07 07:08:44 (GMT)
commit28aa4a06842bb4a27b6c41b61bc52da74cad669e (patch)
tree4c3e5bae19b3f200e3c825012efd27dc5dd1e954 /Lib/random.py
parentc98b26a6ac0e5e68dd2eb820430cc2a44b4df019 (diff)
downloadcpython-28aa4a06842bb4a27b6c41b61bc52da74cad669e.zip
cpython-28aa4a06842bb4a27b6c41b61bc52da74cad669e.tar.gz
cpython-28aa4a06842bb4a27b6c41b61bc52da74cad669e.tar.bz2
Rename weighted_choices() to just choices()
Diffstat (limited to 'Lib/random.py')
-rw-r--r--Lib/random.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/random.py b/Lib/random.py
index 136395e..cd8583f 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -51,7 +51,7 @@ __all__ = ["Random","seed","random","uniform","randint","choice","sample",
"randrange","shuffle","normalvariate","lognormvariate",
"expovariate","vonmisesvariate","gammavariate","triangular",
"gauss","betavariate","paretovariate","weibullvariate",
- "getstate","setstate", "getrandbits", "weighted_choices",
+ "getstate","setstate", "getrandbits", "choices",
"SystemRandom"]
NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0)
@@ -337,7 +337,7 @@ class Random(_random.Random):
result[i] = population[j]
return result
- def weighted_choices(self, k, population, weights=None, *, cum_weights=None):
+ def choices(self, k, population, weights=None, *, cum_weights=None):
"""Return a k sized list of population elements chosen with replacement.
If the relative weights or cumulative weights are not specified,
@@ -749,7 +749,7 @@ choice = _inst.choice
randrange = _inst.randrange
sample = _inst.sample
shuffle = _inst.shuffle
-weighted_choices = _inst.weighted_choices
+choices = _inst.choices
normalvariate = _inst.normalvariate
lognormvariate = _inst.lognormvariate
expovariate = _inst.expovariate