Skip to content

Commit 099620b

Browse files
authored
[3.11] Backport docstring improvement from 3.12 (#98288)
Backport docstring improvement from 3.12
1 parent 42511fc commit 099620b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/random.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,10 @@ def randbytes(self, n):
282282
## -------------------- integer methods -------------------
283283

284284
def randrange(self, start, stop=None, step=_ONE):
285-
"""Choose a random item from range(start, stop[, step]).
285+
"""Choose a random item from range(stop) or range(start, stop[, step]).
286286
287-
This fixes the problem with randint() which includes the
288-
endpoint; in Python this is usually not what you want.
287+
Roughly equivalent to ``choice(range(start, stop, step))`` but
288+
supports arbitrarily large ranges and is optimized for common cases.
289289
290290
"""
291291

0 commit comments

Comments
 (0)