Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63b1767

Browse files
committed
Improve variable name (don't shadow a builtin).
1 parent 8ff1099 commit 63b1767

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/random.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,9 @@ def getrandbits(self, k):
634634
raise ValueError('number of bits must be greater than zero')
635635
if k != int(k):
636636
raise TypeError('number of bits should be an integer')
637-
bytes = (k + 7) // 8 # bits / 8 and rounded up
638-
x = int.from_bytes(_urandom(bytes), 'big')
639-
return x >> (bytes * 8 - k) # trim excess bits
637+
numbytes = (k + 7) // 8 # bits / 8 and rounded up
638+
x = int.from_bytes(_urandom(numbytes), 'big')
639+
return x >> (numbytes * 8 - k) # trim excess bits
640640

641641
def seed(self, *args, **kwds):
642642
"Stub method. Not used for a system random number generator."

0 commit comments

Comments
 (0)