]> granicus.if.org Git - python/commitdiff
New comment block to Clarify a subtlety.
authorTim Peters <tim.peters@gmail.com>
Fri, 26 Jan 2001 22:56:56 +0000 (22:56 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 26 Jan 2001 22:56:56 +0000 (22:56 +0000)
Lib/random.py

index baebdf0474d5f04b8beb41566d5027d06405cfee..b9359e48120d240487b0edbb661ea81c19bdc5ce 100644 (file)
@@ -596,7 +596,11 @@ def _test(N=200):
     if r1 != r2:
         raise ValueError("jumpahead test failed " + `(N, r1, r2)`)
 
-# Initialize from current time.
+# Create one instance, seeded from current time, and export its methods
+# as module-level functions.  The functions are not threadsafe, and state
+# is shared across all uses (both in the user's code and in the Python
+# libraries), but that's fine for most programs and is easier for the
+# casual user than making them instantiate their own Random() instance.
 _inst = Random()
 seed = _inst.seed
 random = _inst.random