[Python-checkins] random module: Convert a "while 1" to "while True (GH-21700)

Raymond Hettinger webhook-mailer at python.org
Sun Aug 2 15:04:00 EDT 2020


https://github.com/python/cpython/commit/6a613f90bf13038255bca028feeab6fad816edfd
commit: 6a613f90bf13038255bca028feeab6fad816edfd
branch: master
author: Raymond Hettinger <rhettinger at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-08-02T12:03:32-07:00
summary:

random module: Convert a "while 1" to "while True (GH-21700)

files:
M Lib/random.py

diff --git a/Lib/random.py b/Lib/random.py
index 37f71110403ad..3ea369b81b3e5 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -682,7 +682,7 @@ def gammavariate(self, alpha, beta):
             bbb = alpha - LOG4
             ccc = alpha + ainv
 
-            while 1:
+            while True:
                 u1 = random()
                 if not 1e-7 < u1 < 0.9999999:
                     continue



More information about the Python-checkins mailing list