diff options
author | Raymond Hettinger <python@rcn.com> | 2016-11-02 05:23:11 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2016-11-02 05:23:11 (GMT) |
commit | 8567e58ae3bdf346e46a100d398da8bbb05b8656 (patch) | |
tree | 9962ab72e175f1ae5feaeb7bd5eafd78763009df /Lib/random.py | |
parent | 16ef5d4ae120eb412562fd1826bc56863dc416e7 (diff) | |
download | cpython-8567e58ae3bdf346e46a100d398da8bbb05b8656.zip cpython-8567e58ae3bdf346e46a100d398da8bbb05b8656.tar.gz cpython-8567e58ae3bdf346e46a100d398da8bbb05b8656.tar.bz2 |
Minor code beautification
Diffstat (limited to 'Lib/random.py')
-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): |