]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document randrange().
authorFred Drake <fdrake@acm.org>
Fri, 30 Jun 2000 15:32:31 +0000 (15:32 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 30 Jun 2000 15:32:31 +0000 (15:32 +0000)
Doc/lib/librandom.tex

index e7f0d583016ae0ae0cff498c0d3a7f51fc75091b..15ed69cd67866b2c69ed9582813b7654843bed68 100644 (file)
@@ -113,6 +113,7 @@ returns it.
 \end{funcdesc}
 
 \begin{funcdesc}{randint}{a, b}
+\deprecated{2.0}{Use \function{randrange()} instead.}
 Returns a random integer \var{N} such that
 \code{\var{a} <= \var{N} <= \var{b}}.
 \end{funcdesc}
@@ -122,6 +123,13 @@ Returns the next random floating point number in the range [0.0
 ... 1.0).
 \end{funcdesc}
 
+\begin{funcdesc}{randrange}{\optional{start,} stop\optional{, step}}
+Return a randomly selected element from \code{range(\var{start},
+\var{stop}, \var{step})}.  This is equivalent to
+\code{choice(range(\var{start}, \var{stop}, \var{step}))}.
+\versionadded{1.5.2}
+\end{funcdesc}
+
 \begin{funcdesc}{uniform}{a, b}
 Returns a random real number \var{N} such that
 \code{\var{a} <= \var{N} < \var{b}}.