[Python-checkins] cpython (merge 3.6 -> default): merge
raymond.hettinger
python-checkins at python.org
Wed Nov 2 01:23:40 EDT 2016
https://hg.python.org/cpython/rev/b671422240cd
changeset: 104868:b671422240cd
parent: 104865:a6e59a2e880e
parent: 104867:3786e5830c73
user: Raymond Hettinger <python at rcn.com>
date: Tue Nov 01 22:23:34 2016 -0700
summary:
merge
files:
Lib/random.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Lib/random.py b/Lib/random.py
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -350,8 +350,7 @@
_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):
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list