summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-12-15 19:07:17 (GMT)
committerFred Drake <fdrake@acm.org>2000-12-15 19:07:17 (GMT)
commit065cba1281384de5ba18a2ed37d6761b8c788499 (patch)
tree038036feac1500236f5b2e212411c06bcf6943cd /Doc
parente6e03eafed6cf88e350075e89da662b76dfe0fa8 (diff)
downloadcpython-065cba1281384de5ba18a2ed37d6761b8c788499.zip
cpython-065cba1281384de5ba18a2ed37d6761b8c788499.tar.gz
cpython-065cba1281384de5ba18a2ed37d6761b8c788499.tar.bz2
Added documentation for random.shuffle().
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/librandom.tex17
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/lib/librandom.tex b/Doc/lib/librandom.tex
index 15ed69c..54bca0f 100644
--- a/Doc/lib/librandom.tex
+++ b/Doc/lib/librandom.tex
@@ -88,6 +88,23 @@ Weibull distribution. \var{alpha} is the scale parameter and
\var{beta} is the shape parameter.
\end{funcdesc}
+
+This function does not represent a specific distribution, but
+implements a standard useful algorithm:
+
+\begin{funcdesc}{shuffle}{x\optional{, random}}
+Shuffle the sequence \var{x} in place.
+The optional argument \var{random} is a 0-argument function returning
+a random float in [0.0, 1.0); by default, this is the function
+\function{random()}.
+
+Note that for even rather small \code{len(\var{x})}, the total number
+of permutations of \var{x} is larger than the period of most random
+number generators; this implies that most permutations of a long
+sequence can never be generated.
+\end{funcdesc}
+
+
\begin{seealso}
\seemodule{whrandom}{The standard Python random number generator.}
\end{seealso}