[3.11] Backport docstring improvement from 3.12 (#98288)

Backport docstring improvement from 3.12
This commit is contained in:
Raymond Hettinger 2022-10-15 13:11:04 -05:00 committed by GitHub
parent 42511fc72d
commit 099620b0ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -282,10 +282,10 @@ class Random(_random.Random):
## -------------------- integer methods -------------------
def randrange(self, start, stop=None, step=_ONE):
"""Choose a random item from range(start, stop[, step]).
"""Choose a random item from range(stop) or range(start, stop[, step]).
This fixes the problem with randint() which includes the
endpoint; in Python this is usually not what you want.
Roughly equivalent to ``choice(range(start, stop, step))`` but
supports arbitrarily large ranges and is optimized for common cases.
"""