summaryrefslogtreecommitdiffstats
path: root/Doc/library/random.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/random.rst')
-rw-r--r--Doc/library/random.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
index f08192d..c9e703c 100644
--- a/Doc/library/random.rst
+++ b/Doc/library/random.rst
@@ -68,6 +68,17 @@ Bookkeeping functions:
the time :func:`setstate` was called.
+.. function:: jumpahead(n)
+
+ Change the internal state to one different from and likely far away from the
+ current state. *n* is a non-negative integer which is used to scramble the
+ current state vector. This is most useful in multi-threaded programs, in
+ conjunction with multiple instances of the :class:`Random` class:
+ :meth:`setstate` or :meth:`seed` can be used to force all instances into the
+ same internal state, and then :meth:`jumpahead` can be used to force the
+ instances' states far apart.
+
+
.. function:: getrandbits(k)
Returns a python integer with *k* random bits. This method is supplied with