summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2010-09-06 23:36:31 (GMT)
committerRaymond Hettinger <python@rcn.com>2010-09-06 23:36:31 (GMT)
commit435cb0f23304d57b0cafb2a4449a41150f7fffa9 (patch)
treef854681ef9bf74e294a66a60f67035c0de27ae4a /Doc
parent616453c19977c72fb6cbec19d133c1088f5d20fe (diff)
downloadcpython-435cb0f23304d57b0cafb2a4449a41150f7fffa9.zip
cpython-435cb0f23304d57b0cafb2a4449a41150f7fffa9.tar.gz
cpython-435cb0f23304d57b0cafb2a4449a41150f7fffa9.tar.bz2
Document which part of the random module module are guaranteed.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/random.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
index bf89ade..6ef5d20 100644
--- a/Doc/library/random.rst
+++ b/Doc/library/random.rst
@@ -270,3 +270,19 @@ Examples of basic usage::
<http://code.activestate.com/recipes/576707/>`_ for a compatible alternative
random number generator with a long period and comparatively simple update
operations.
+
+Notes on Reproducibility
+========================
+
+Sometimes it is useful to be able to reproduce the sequences given by a pseudo
+random number generator. By re-using a seed value, the same sequence should be
+reproducible from run to run as long as multiple threads are not running.
+
+Most of the random module's algorithms and seeding functions are subject to
+change across Python versions, but two aspects are guaranteed not to change:
+
+* If a new seeding method is added, then a backward compatible seeder will be
+ offered.
+
+* The generator's :meth:`random` method will continue to produce the same
+ sequence when the compatible seeder is given the same seed.