summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-11-02 05:23:34 (GMT)
committerRaymond Hettinger <python@rcn.com>2016-11-02 05:23:34 (GMT)
commit79a188c2bb1d64613701ada78c2e339e1ff6055e (patch)
tree413980f6dee17ade30110e51696015407843c7bf
parent94d73e94a1c4609c2ee3ec84f4097f5774e61a57 (diff)
parent8567e58ae3bdf346e46a100d398da8bbb05b8656 (diff)
downloadcpython-79a188c2bb1d64613701ada78c2e339e1ff6055e.zip
cpython-79a188c2bb1d64613701ada78c2e339e1ff6055e.tar.gz
cpython-79a188c2bb1d64613701ada78c2e339e1ff6055e.tar.bz2
merge
-rw-r--r--Lib/random.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/random.py b/Lib/random.py
index a047444..d557acc 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -350,8 +350,7 @@ class Random(_random.Random):
_int = int
total = len(population)
return [population[_int(random() * total)] for i in range(k)]
- else:
- cum_weights = list(_itertools.accumulate(weights))
+ cum_weights = list(_itertools.accumulate(weights))
elif weights is not None:
raise TypeError('Cannot specify both weights and cumulative_weights')
if len(cum_weights) != len(population):