diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2022-10-15 18:11:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-15 18:11:04 (GMT) |
commit | 099620b0ce964ffe85fc52a7595ece13a55ca81c (patch) | |
tree | d744274f770ac7909a3e00c6807c196ad4ee0328 | |
parent | 42511fc72d7dd9f4c5a57a5d88ae20262be2faf7 (diff) | |
download | cpython-099620b0ce964ffe85fc52a7595ece13a55ca81c.zip cpython-099620b0ce964ffe85fc52a7595ece13a55ca81c.tar.gz cpython-099620b0ce964ffe85fc52a7595ece13a55ca81c.tar.bz2 |
[3.11] Backport docstring improvement from 3.12 (#98288)
Backport docstring improvement from 3.12
-rw-r--r-- | Lib/random.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/random.py b/Lib/random.py index 1f3530e..f94616e 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -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. """ |