summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-01-26 22:56:56 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-01-26 22:56:56 (GMT)
commit715c4c412b21f68ad59773698d06eea8eb0c5a44 (patch)
tree5c4b10691a5a8ab13c5f64f78816a4d7d236a82d /Lib/random.py
parentc975f031706add1a63276b1629aa390d9e330da8 (diff)
downloadcpython-715c4c412b21f68ad59773698d06eea8eb0c5a44.zip
cpython-715c4c412b21f68ad59773698d06eea8eb0c5a44.tar.gz
cpython-715c4c412b21f68ad59773698d06eea8eb0c5a44.tar.bz2
New comment block to Clarify a subtlety.
Diffstat (limited to 'Lib/random.py')
-rw-r--r--Lib/random.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/random.py b/Lib/random.py
index baebdf0..b9359e4 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -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