diff options
author | Raymond Hettinger <python@rcn.com> | 2009-02-24 10:57:02 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-02-24 10:57:02 (GMT) |
commit | afd30450251f7857aae8fbaaf4344ab04fac44f5 (patch) | |
tree | 8f9e01774951790bbc652d8fdabcaede9e6c5456 /Doc/library/random.rst | |
parent | 29c0c7c4bd0df8f48cc8434d07a56f30d0d6b647 (diff) | |
download | cpython-afd30450251f7857aae8fbaaf4344ab04fac44f5.zip cpython-afd30450251f7857aae8fbaaf4344ab04fac44f5.tar.gz cpython-afd30450251f7857aae8fbaaf4344ab04fac44f5.tar.bz2 |
Fix-up random docs. Jumpahead was removed long ago. Other minor corrections.
Diffstat (limited to 'Doc/library/random.rst')
-rw-r--r-- | Doc/library/random.rst | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 5dcf764..cab6d2f 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -32,7 +32,7 @@ instances of :class:`Random` to get generators that don't share state. 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 @@ 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 @@ -96,7 +85,8 @@ Functions for integers: .. 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 @@ Alternative Generators: 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. |