From: Raymond Hettinger Date: Wed, 2 Nov 2016 05:23:11 +0000 (-0700) Subject: Minor code beautification X-Git-Tag: v3.6.0b4~166 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8567e58ae3bdf346e46a100d398da8bbb05b8656;p=thirdparty%2FPython%2Fcpython.git Minor code beautification --- diff --git a/Lib/random.py b/Lib/random.py index a047444502d9..d557acc92b97 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):