diff options
author | jonanifranco <66563903+jonanifranco@users.noreply.github.com> | 2021-01-18 18:04:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-18 18:04:29 (GMT) |
commit | f7b5bacd7a0b2084ce699eda6f6f4b1adfa16590 (patch) | |
tree | be30043c18594b8c9d4d7c2f59c87fb1a1074833 /Lib/random.py | |
parent | 314b8787e0c50985ba708034b84ff5b37a1d47de (diff) | |
download | cpython-f7b5bacd7a0b2084ce699eda6f6f4b1adfa16590.zip cpython-f7b5bacd7a0b2084ce699eda6f6f4b1adfa16590.tar.gz cpython-f7b5bacd7a0b2084ce699eda6f6f4b1adfa16590.tar.bz2 |
bpo-42944 Fix Random.sample when counts is not None (GH-24235)
Diffstat (limited to 'Lib/random.py')
-rw-r--r-- | Lib/random.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/random.py b/Lib/random.py index db0e6c2..30186fc 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -479,7 +479,7 @@ class Random(_random.Random): raise TypeError('Counts must be integers') if total <= 0: raise ValueError('Total of counts must be greater than zero') - selections = sample(range(total), k=k) + selections = self.sample(range(total), k=k) bisect = _bisect return [population[bisect(cum_counts, s)] for s in selections] randbelow = self._randbelow |