828
828
indices = sorted(random.randrange(n) for i in xrange(r))
829
829
return tuple(pool[i] for i in indices)
831
843
Note, many of the above recipes can be optimized by replacing global lookups
832
844
with local variables defined as default values. For example, the
833
845
*dotproduct* recipe can be written as::