Issues #7889, #9025 and #9379: Improvements to the random module.

This commit is contained in:
Raymond Hettinger 2010-09-07 04:44:52 +00:00
parent 3051cc3a0d
commit 0515661314
4 changed files with 46 additions and 25 deletions

View file

@ -98,6 +98,13 @@ Functions for integers:
equivalent to ``choice(range(start, stop, step))``, but doesn't actually build a
range object.
The positional argument pattern matches that of :func:`range`. Keyword arguments
should not be used because the function may use them in unexpected ways.
.. versionchanged:: 3.2
:meth:`randrange` is more sophisticated about producing equally distributed
values. Formerly it used a style like ``int(random()*n)`` which could produce
slightly uneven distributions.
.. function:: randint(a, b)