mirror of https://github.com/python/cpython
merge
This commit is contained in:
commit
79a188c2bb
|
@ -350,7 +350,6 @@ class Random(_random.Random):
|
||||||
_int = int
|
_int = int
|
||||||
total = len(population)
|
total = len(population)
|
||||||
return [population[_int(random() * total)] for i in range(k)]
|
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:
|
elif weights is not None:
|
||||||
raise TypeError('Cannot specify both weights and cumulative_weights')
|
raise TypeError('Cannot specify both weights and cumulative_weights')
|
||||||
|
|
Loading…
Reference in New Issue