[Python-checkins] CVS: python/dist/src/Doc/lib librandom.tex,1.14,1.15
Fred L. Drake
python-dev@python.org
Fri, 15 Dec 2000 11:07:20 -0800
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv1307/lib
Modified Files:
librandom.tex
Log Message:
Added documentation for random.shuffle().
Index: librandom.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/librandom.tex,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** librandom.tex 2000/06/30 15:32:31 1.14
--- librandom.tex 2000/12/15 19:07:17 1.15
***************
*** 89,92 ****
--- 89,109 ----
\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.}