diff options
author | Fred Drake <fdrake@acm.org> | 2000-06-30 19:33:35 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-06-30 19:33:35 (GMT) |
commit | 0412e494b86c9b45fb57aad9bf741c8cae8046f9 (patch) | |
tree | 1f711536d424f922bf7866323b19acaa99851f88 /Lib | |
parent | f857ac97e97615809529aae7479887e66e4a8c27 (diff) | |
download | cpython-0412e494b86c9b45fb57aad9bf741c8cae8046f9.zip cpython-0412e494b86c9b45fb57aad9bf741c8cae8046f9.tar.gz cpython-0412e494b86c9b45fb57aad9bf741c8cae8046f9.tar.bz2 |
Line-wrap and properly indent a couple of docstrings.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/whrandom.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/whrandom.py b/Lib/whrandom.py index 8cc1650..f43b2f9 100644 --- a/Lib/whrandom.py +++ b/Lib/whrandom.py @@ -82,7 +82,9 @@ class whrandom: return a + (b-a) * self.random() 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.)""" return self.randrange(a, b+1) @@ -91,10 +93,11 @@ class whrandom: return seq[int(self.random() * len(seq))] 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 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 # common case while still doing adequate error checking istart = int(start) |