creating an instance of a random number generator

Jeff Stearns (jps@tfs.com)
Thu, 6 Apr 1995 22:32:59 GMT

I wonder if somebody can tell me why the following doesn't work.

I have a multi-threaded program. Within each thread, I want to
create an instance of a random number generator. I want to do
this so that each thread follows the same pseudo-random sequence.

I am thinking that saying
import whrandom
wh = whrandom(seed1, seed2, seed3)
should give me an instance of a random-number generator; I could then
use it by saying
rand = wh.random()

Python disagrees; it claims that "wh = whrandom(seed1, seed2, seed3)"
is a "call of a non-function".

I don't understand why. whrandom seems no different from other classes
that I create or use.

Can anybody enlighten me? BTW, this is python 1.0.3 on Solaris.

thanks -jeff stearns jps@tfs.com