]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42559: Not that getrandbits() is non-negative. (GH-23843) (GH-23851)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 19 Dec 2020 03:10:06 +0000 (19:10 -0800)
committerGitHub <noreply@github.com>
Sat, 19 Dec 2020 03:10:06 +0000 (19:10 -0800)
Doc/library/random.rst

index 8154dfc18ccc6db63d48f84082e4d0e203a127c3..0e703251259aa756ebcf5c665e03f7fb59b52f84 100644 (file)
@@ -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*.