From 8567e58ae3bdf346e46a100d398da8bbb05b8656 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 1 Nov 2016 22:23:11 -0700 Subject: [PATCH] Minor code beautification --- Lib/random.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/random.py b/Lib/random.py index a047444502d..d557acc92b9 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):