From: Raymond Hettinger Date: Sat, 19 Dec 2020 01:03:10 +0000 (-0800) Subject: bpo-42559: Not that getrandbits() is non-negative. (GH-23843) X-Git-Tag: v3.10.0a4~125 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5646414ae1fce620b919056f7999dfd15da78e9c;p=thirdparty%2FPython%2Fcpython.git bpo-42559: Not that getrandbits() is non-negative. (GH-23843) --- diff --git a/Doc/library/random.rst b/Doc/library/random.rst index c243aced986e..fa5c74b40b25 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*.