mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
New comment block to Clarify a subtlety.
This commit is contained in:
parent
c975f03170
commit
715c4c412b
1 changed files with 5 additions and 1 deletions
|
@ -596,7 +596,11 @@ def _test(N=200):
|
||||||
if r1 != r2:
|
if r1 != r2:
|
||||||
raise ValueError("jumpahead test failed " + `(N, 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()
|
_inst = Random()
|
||||||
seed = _inst.seed
|
seed = _inst.seed
|
||||||
random = _inst.random
|
random = _inst.random
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue