summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2020-12-19 01:03:10 (GMT)
committerGitHub <noreply@github.com>2020-12-19 01:03:10 (GMT)
commit5646414ae1fce620b919056f7999dfd15da78e9c (patch)
treecaf912713c1ecaf6c4cc93de054d65dbe043a930
parent51f4688254ebb7b30215de424360ba5c92c63fe8 (diff)
downloadcpython-5646414ae1fce620b919056f7999dfd15da78e9c.zip
cpython-5646414ae1fce620b919056f7999dfd15da78e9c.tar.gz
cpython-5646414ae1fce620b919056f7999dfd15da78e9c.tar.bz2
bpo-42559: Not that getrandbits() is non-negative. (GH-23843)
-rw-r--r--Doc/library/random.rst9
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
index c243ace..fa5c74b 100644
--- a/Doc/library/random.rst
+++ b/Doc/library/random.rst
@@ -142,10 +142,11 @@ Functions for integers
.. function:: getrandbits(k)
- Returns a Python integer with *k* random bits. This method is supplied with
- the MersenneTwister generator and some other generators may also provide it
- as an optional part of the API. When available, :meth:`getrandbits` enables
- :meth:`randrange` to handle arbitrarily large ranges.
+ Returns a non-negative Python integer with *k* random bits. This method
+ is supplied with the MersenneTwister generator and some other generators
+ may also provide it as an optional part of the API. When available,
+ :meth:`getrandbits` enables :meth:`randrange` to handle arbitrarily large
+ ranges.
.. versionchanged:: 3.9
This method now accepts zero for *k*.