bpo-42559: Not that getrandbits() is non-negative. (GH-23843)
This commit is contained in:
parent
51f4688254
commit
5646414ae1
|
@ -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*.
|
||||||
|
|
Loading…
Reference in New Issue