mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Line-wrap and properly indent a couple of docstrings.
This commit is contained in:
parent
f857ac97e9
commit
0412e494b8
1 changed files with 6 additions and 3 deletions
|
@ -82,7 +82,9 @@ class whrandom:
|
||||||
return a + (b-a) * self.random()
|
return a + (b-a) * self.random()
|
||||||
|
|
||||||
def randint(self, a, b):
|
def randint(self, a, b):
|
||||||
"""Get a random integer in the range [a, b] including both end points.
|
"""Get a random integer in the range [a, b] including
|
||||||
|
both end points.
|
||||||
|
|
||||||
(Deprecated; use randrange below.)"""
|
(Deprecated; use randrange below.)"""
|
||||||
return self.randrange(a, b+1)
|
return self.randrange(a, b+1)
|
||||||
|
|
||||||
|
@ -91,10 +93,11 @@ class whrandom:
|
||||||
return seq[int(self.random() * len(seq))]
|
return seq[int(self.random() * len(seq))]
|
||||||
|
|
||||||
def randrange(self, start, stop=None, step=1, int=int, default=None):
|
def randrange(self, start, stop=None, step=1, int=int, default=None):
|
||||||
"""Choose a random item from range([start,] step[, stop]).
|
"""Choose a random item from range(start, stop[, step]).
|
||||||
|
|
||||||
This fixes the problem with randint() which includes the
|
This fixes the problem with randint() which includes the
|
||||||
endpoint; in Python this is usually not what you want.
|
endpoint; in Python this is usually not what you want.
|
||||||
Do not supply the 'int' and 'default' arguments."""
|
Do not supply the 'int' and 'default' arguments."""
|
||||||
# This code is a bit messy to make it fast for the
|
# This code is a bit messy to make it fast for the
|
||||||
# common case while still doing adequate error checking
|
# common case while still doing adequate error checking
|
||||||
istart = int(start)
|
istart = int(start)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue