diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-09-14 03:35:09 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-09-14 03:35:09 (GMT) |
commit | 8429b6784bd7447055c7880e1b84954cd27bd0a3 (patch) | |
tree | 9a95f710bda3ba07be9ac91d89007f5b70e9c6fc /Doc/library/random.rst | |
parent | c2085dd765d3fcb46e1e8ee7e908bae8637827e9 (diff) | |
parent | e0add764688a3f3237749e0c2830b669d2c76ca0 (diff) | |
download | cpython-8429b6784bd7447055c7880e1b84954cd27bd0a3.zip cpython-8429b6784bd7447055c7880e1b84954cd27bd0a3.tar.gz cpython-8429b6784bd7447055c7880e1b84954cd27bd0a3.tar.bz2 |
#15831: merge with 3.2
Diffstat (limited to 'Doc/library/random.rst')
-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 23dbd1f..55c9d70 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -52,20 +52,20 @@ from sources provided by the operating system. Bookkeeping functions: -.. function:: seed([x], version=2) +.. function:: seed(a=None, version=2) Initialize the random number generator. - If *x* is omitted or ``None``, the current system time is used. If + If *a* is omitted or ``None``, the current system time is used. If randomness sources are provided by the operating system, they are used instead of the system time (see the :func:`os.urandom` function for details on availability). - If *x* is an int, it is used directly. + If *a* is an int, it is used directly. With version 2 (the default), a :class:`str`, :class:`bytes`, or :class:`bytearray` object gets converted to an :class:`int` and all of its bits are used. With version 1, - the :func:`hash` of *x* is used instead. + the :func:`hash` of *a* is used instead. .. versionchanged:: 3.2 Moved to the version 2 scheme which uses all of the bits in a string seed. @@ -93,7 +93,8 @@ Bookkeeping functions: Functions for integers: -.. function:: randrange([start,] stop[, step]) +.. function:: randrange(stop) + randrange(start, stop[, step]) Return a randomly selected element from ``range(start, stop, step)``. This is equivalent to ``choice(range(start, stop, step))``, but doesn't actually build a |