bpo-42559: Not that getrandbits() is non-negative. (GH-23843) (GH-23851)

This commit is contained in:
Miss Islington (bot) 2020-12-18 19:10:06 -08:00 committed by GitHub
parent 782665885c
commit d458d8dab0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,10 +142,11 @@ Functions for integers
.. function:: getrandbits(k) .. function:: getrandbits(k)
Returns a Python integer with *k* random bits. This method is supplied with Returns a non-negative Python integer with *k* random bits. This method
the MersenneTwister generator and some other generators may also provide it is supplied with the MersenneTwister generator and some other generators
as an optional part of the API. When available, :meth:`getrandbits` enables may also provide it as an optional part of the API. When available,
:meth:`randrange` to handle arbitrarily large ranges. :meth:`getrandbits` enables :meth:`randrange` to handle arbitrarily large
ranges.
.. versionchanged:: 3.9 .. versionchanged:: 3.9
This method now accepts zero for *k*. This method now accepts zero for *k*.