diff options
author | Raymond Hettinger <python@rcn.com> | 2010-09-08 19:27:59 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-09-08 19:27:59 (GMT) |
commit | 63b17671f00aafefc01c9b6d541d48c842e523b7 (patch) | |
tree | fcbe03dd5c6ae1cd11d1b02f8f5e725c05f6884c /Lib/random.py | |
parent | 8ff1099684ae24dfc253d14e46d65a6c2023d537 (diff) | |
download | cpython-63b17671f00aafefc01c9b6d541d48c842e523b7.zip cpython-63b17671f00aafefc01c9b6d541d48c842e523b7.tar.gz cpython-63b17671f00aafefc01c9b6d541d48c842e523b7.tar.bz2 |
Improve variable name (don't shadow a builtin).
Diffstat (limited to 'Lib/random.py')
-rw-r--r-- | Lib/random.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/random.py b/Lib/random.py index e4073dd..83a070c 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -634,9 +634,9 @@ class SystemRandom(Random): raise ValueError('number of bits must be greater than zero') if k != int(k): raise TypeError('number of bits should be an integer') - bytes = (k + 7) // 8 # bits / 8 and rounded up - x = int.from_bytes(_urandom(bytes), 'big') - return x >> (bytes * 8 - k) # trim excess bits + numbytes = (k + 7) // 8 # bits / 8 and rounded up + x = int.from_bytes(_urandom(numbytes), 'big') + return x >> (numbytes * 8 - k) # trim excess bits def seed(self, *args, **kwds): "Stub method. Not used for a system random number generator." |