random changes

Andrew Dalke adalke at mindspring.com
Thu Aug 7 15:58:02 EDT 2003


dan:
> next time the core RNG is changed, I think it would be useful to have
> an -oldrandom switch.  [...] In bumping to 2.3 with the new Mersenne
> algorithm, I have no easy way of duplicating my old results.

Isn't the random.WichmannHill implement the old code?  If so,
what about the following untested code?

import random

random = random.WichmannHill()
random.seed(5)
print random.random()

Failing that, what about copying the old Python code as "oldrandom.py"
then doing

import oldrandom as random

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list