From 0412e494b86c9b45fb57aad9bf741c8cae8046f9 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Fri, 30 Jun 2000 19:33:35 +0000 Subject: Line-wrap and properly indent a couple of docstrings. --- Lib/whrandom.py | 9 ++++++--- 1 file 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) -- cgit v0.12