[Python-Dev] Unittests

Andrew P. Lentvorski bsder@allcaps.org
Tue, 9 Apr 2002 15:49:10 -0700 (PDT)


On Tue, 9 Apr 2002, Aahz wrote:

> On Tue, Apr 09, 2002, Neal Norwitz wrote:
> >
> > whrandom.py
>
> This is a deprecated module, no?

What is the "Official Python(tm)" method for generating a "guaranteed for
all time to always be the same if started with the same seed" string of
random numbers for use in something like a UnitTest?

The Random module does not seem to make any promises about repeatability
between versions, releases, operating-systems, etc.  The only thing which
enforces the repeatability is the fact that the generator is actually the
whrandom generator under the covers.

Incidentally, a similar question has been asked before and didn't really
get good closure on the response, see:

http://groups.google.com/groups?hl=en&threadm=MPG.16a822cc6abaa77c98970e%40enews.newsguy.com&rnum=1&prev=/groups%3Fq%3Ddanil%2Bwhrandom%26hl%3Den%26selm%3DMPG.16a822cc6abaa77c98970e%2540enews.newsguy.com%26rnum%3D1

(I hope that URL comes through okay, if not search for "danil" and
"whrandom" in your favorite clp search engine)

-a