random module gives same results across all configurations?

Amir Michail amichail at gmail.com
Wed Mar 4 02:52:12 EST 2009


On Mar 4, 2:26 am, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> Amir Michail schrieb:
>
> > On Mar 3, 10:05 pm, Chris Rebert <c... at rebertia.com> wrote:
> >> On Tue, Mar 3, 2009 at 6:59 PM, Amir Michail <amich... at gmail.com> wrote:
> >>> Hi,
> >>> Is it the case that the random module will always give the same
> >>> results if given the same seed across all configurations (e.g.,
> >>> architectures, compilers, etc.)?
> >> Your question is vague. Define what you mean by "same results" in this context.
>
> > In Python 2.5, if you use the same seed, will calls to randrange yield
> > the same numbers across all configurations?
>
> What do you mean with "configurations"?
>
> Random uses AFAIK rand/srand from the stdlib.h of your platform (*nix,
> no idea how that beast is called in redmond).
>
> So whatever the behaviour, it will be driven by that, and I guess it
> varies between platforms.
>
> Diez

So far I get the same results under Mac OS X, Windows, and Linux
(Google App Engine).  I'm particularly interested in getting the same
results under the Google App Engine even as Google upgrades its
servers over time.

Amir



More information about the Python-list mailing list