diff options
author | Raymond Hettinger <python@rcn.com> | 2016-11-02 05:23:34 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2016-11-02 05:23:34 (GMT) |
commit | 79a188c2bb1d64613701ada78c2e339e1ff6055e (patch) | |
tree | 413980f6dee17ade30110e51696015407843c7bf | |
parent | 94d73e94a1c4609c2ee3ec84f4097f5774e61a57 (diff) | |
parent | 8567e58ae3bdf346e46a100d398da8bbb05b8656 (diff) | |
download | cpython-79a188c2bb1d64613701ada78c2e339e1ff6055e.zip cpython-79a188c2bb1d64613701ada78c2e339e1ff6055e.tar.gz cpython-79a188c2bb1d64613701ada78c2e339e1ff6055e.tar.bz2 |
merge
-rw-r--r-- | Lib/random.py | 3 |
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): |