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

Skip to content

Commit 8a55e2f

Browse files
bpo-37000: Remove obsolete comment in _randbelow_with_getrandbits (#95775)
1 parent 41c939c commit 8a55e2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def _randbelow_with_getrandbits(self, n):
239239
"Return a random int in the range [0,n). Defined for n > 0."
240240

241241
getrandbits = self.getrandbits
242-
k = n.bit_length() # don't use (n-1) here because n can be 1
242+
k = n.bit_length()
243243
r = getrandbits(k) # 0 <= r < 2**k
244244
while r >= n:
245245
r = getrandbits(k)

0 commit comments

Comments
 (0)