[Python-checkins] r69930 - python/branches/py3k/Doc/library/random.rst
raymond.hettinger
python-checkins at python.org
Tue Feb 24 11:57:03 CET 2009
Author: raymond.hettinger
Date: Tue Feb 24 11:57:02 2009
New Revision: 69930
Log:
Fix-up random docs. Jumpahead was removed long ago. Other minor corrections.
Modified:
python/branches/py3k/Doc/library/random.rst
Modified: python/branches/py3k/Doc/library/random.rst
==============================================================================
--- python/branches/py3k/Doc/library/random.rst (original)
+++ python/branches/py3k/Doc/library/random.rst Tue Feb 24 11:57:02 2009
@@ -32,7 +32,7 @@
Class :class:`Random` can also be subclassed if you want to use a different
basic generator of your own devising: in that case, override the :meth:`random`,
-:meth:`seed`, :meth:`getstate`, and :meth:`setstate`.
+:meth:`seed`, :meth:`getstate`, and :meth:`setstate` methods.
Optionally, a new generator can supply a :meth:`getrandbits` method --- this
allows :meth:`randrange` to produce selections over an arbitrarily large range.
@@ -66,17 +66,6 @@
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
@@ -96,7 +85,8 @@
.. function:: randint(a, b)
- Return a random integer *N* such that ``a <= N <= b``.
+ Return a random integer *N* such that ``a <= N <= b``. Alias for
+ ``randrange(a, b+1)``.
Functions for sequences:
@@ -228,7 +218,7 @@
Class that uses the :func:`os.urandom` function for generating random numbers
from sources provided by the operating system. Not available on all systems.
Does not rely on software state and sequences are not reproducible. Accordingly,
- the :meth:`seed` and :meth:`jumpahead` methods have no effect and are ignored.
+ the :meth:`seed` method has no effect and is ignored.
The :meth:`getstate` and :meth:`setstate` methods raise
:exc:`NotImplementedError` if called.
More information about the Python-checkins
mailing list