diff options
author | Raymond Hettinger <python@rcn.com> | 2017-01-07 00:13:37 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2017-01-07 00:13:37 (GMT) |
commit | 9b7ae96b98238627751e2f508ba5d600363555ef (patch) | |
tree | 47df1395ee5030abc3968634bd88240691e13500 /Lib/random.py | |
parent | 9220111fc5e2ed6503fc3260e09faeec5101c7d8 (diff) | |
download | cpython-9b7ae96b98238627751e2f508ba5d600363555ef.zip cpython-9b7ae96b98238627751e2f508ba5d600363555ef.tar.gz cpython-9b7ae96b98238627751e2f508ba5d600363555ef.tar.bz2 |
Issue #29023: Clarify that ints and longs are always deterministic seeds for random.
Diffstat (limited to 'Lib/random.py')
-rw-r--r-- | Lib/random.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/random.py b/Lib/random.py index 3f96a37..11fd35b 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -98,12 +98,14 @@ class Random(_random.Random): self.gauss_next = None def seed(self, a=None): - """Initialize internal state from hashable object. + """Initialize internal state of the random number generator. None or no argument seeds from current time or from an operating system specific randomness source if available. - If a is not None or an int or long, hash(a) is used instead. + If a is not None or is an int or long, hash(a) is used instead. + Hash values for some types are nondeterministic when the + PYTHONHASHSEED environment variable is enabled. """ if a is None: |