diff options
author | Georg Brandl <georg@python.org> | 2016-02-19 07:57:23 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2016-02-19 07:57:23 (GMT) |
commit | d6dd0e65601355bfff52c85b3ac7800ed7edffb5 (patch) | |
tree | f50cbf18603664f7dde937bb1abd3d567128eea3 | |
parent | 94035f3aa755ff7541bcb4c280503af86a8bf242 (diff) | |
download | cpython-d6dd0e65601355bfff52c85b3ac7800ed7edffb5.zip cpython-d6dd0e65601355bfff52c85b3ac7800ed7edffb5.tar.gz cpython-d6dd0e65601355bfff52c85b3ac7800ed7edffb5.tar.bz2 |
Closes #20169: fix inner links random doc.
-rw-r--r-- | Doc/library/random.rst | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 1bc9989..1316d2d 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -19,7 +19,7 @@ On the real line, there are functions to compute uniform, normal (Gaussian), lognormal, negative exponential, gamma, and beta distributions. For generating distributions of angles, the von Mises distribution is available. -Almost all module functions depend on the basic function :func:`random`, which +Almost all module functions depend on the basic function :func:`.random`, which generates a random float uniformly in the semi-open range [0.0, 1.0). Python uses the Mersenne Twister as the core generator. It produces 53-bit precision floats and has a period of 2\*\*19937-1. The underlying implementation in C is @@ -36,9 +36,10 @@ especially useful for multi-threaded programs, creating a different instance of it likely that the generated sequences seen by each thread don't overlap. 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`, :meth:`setstate` and :meth:`jumpahead` methods. -Optionally, a new generator can supply a :meth:`getrandbits` method --- this +basic generator of your own devising: in that case, override the :meth:`~Random.random`, +:meth:`~Random.seed`, :meth:`~Random.getstate`, :meth:`~Random.setstate` and +:meth:`~Random.jumpahead` methods. Optionally, a new generator can supply a +:meth:`~Random.getrandbits` method --- this allows :meth:`randrange` to produce selections over an arbitrarily large range. .. versionadded:: 2.4 @@ -158,7 +159,7 @@ Functions for sequences: Shuffle the sequence *x* in place. The optional argument *random* is a 0-argument function returning a random float in [0.0, 1.0); by default, this is - the function :func:`random`. + the function :func:`.random`. Note that for even rather small ``len(x)``, the total number of permutations of *x* is larger than the period of most random number generators; this implies |