[Python-Dev] Mersenne Twister

Andrew P. Lentvorski bsder@mail.allcaps.org
Thu, 29 Aug 2002 12:14:30 -0700 (PDT)


On Thu, 29 Aug 2002, Raymond Hettinger wrote:

> -- Add a version number argument to Random() which defaults to two.

Why not have a WHRandom() and a MersenneRandom() instance inside module
random?  That way you can even give a future behavior warning that
Random() is about to change and people can either choose the particular
generator they want or accept the default.

To my mind, this is a case of explicit (actually naming the generator
types) is better than implicit (version number?  Where's my documentation?
Which generator is which version?)  Maybe this isn't a big deal now, but I
can believe that we might accumulate another RNG or two (there are some
good reasons to want *weaker* or correlated RNGs) and having a weaker
generator with a *later* version number is just bound to cause havoc.

-a