Implementaion of random.shuffle

Steven D'Aprano steven at
Tue Jul 17 04:51:13 CEST 2007

On Mon, 16 Jul 2007 16:55:53 +0200, Hrvoje Niksic wrote:

> 2**19937 being a really huge number, it's impossible to exhaust the
> Mersenne twister by running it in sequence.


Surely this will do it:

for n in xrange(2**19937 + 1):

Admittedly, if each call to random() took a picosecond, it would still 
take 1e5982 centuries to run through the lot. You might want to go make a 
coffee or something while you're waiting...


More information about the Python-list mailing list