[Python-checkins] cpython (3.6): Minor code beautification

raymond.hettinger python-checkins at python.org
Wed Nov 2 01:23:40 EDT 2016


https://hg.python.org/cpython/rev/3786e5830c73
changeset:   104867:3786e5830c73
branch:      3.6
parent:      104864:fc6f90d8022b
user:        Raymond Hettinger <python at rcn.com>
date:        Tue Nov 01 22:23:11 2016 -0700
summary:
  Minor code beautification

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