Different Random Numbers Between Already/Not Yet Compiled Code

Eric Eide eeide at cs.utah.edu
Wed Jan 23 18:56:28 CET 2002


"Tim" == Tim Peters <tim.one at home.com> writes:

	Tim> That's not so interesting as the exact code you use to set the
	Tim> seed, whether you're using threads, and whether you're using any
	Tim> standard or extension modules that also use the default random
	Tim> instance.

The seed is code is basically: random.seed(1).

I'm not using multiple threads.

The last I'm not sure of, but I would hope that such any such modules would at
least have predictable behavior between compiled and non-compiled code.

	Tim> It may have to do with that, back in 2.0, the values of manifest
	Tim> floating-point constants could change between .py and .pyc
	Tim> formats, due to ill-considered rounding in the .pyc format.

As an experiment, I downloaded and compiled Python 2.2.  The behavior is the
same (although I do get a different series of random numbers, I assume because
the `random.py' library module has changed).  My simulation runs (predictably)
differently between compiled and non-compiled versions.

It looks like this is interesting enough for me to track down.  Does anyone
have any advice as to how I might go about finding ``interesting callers'' of
the `random' module?

Thanks ---

Eric.

-- 
-------------------------------------------------------------------------------
Eric Eide <eeide at cs.utah.edu>  .         University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX



More information about the Python-list mailing list