gotcha or bug? random state reset on irrelevant import

Alan Isaac aisaac at american.edu
Tue Apr 24 22:09:42 EDT 2007


"John Machin" <sjmachin at lexicon.net> wrote in message
news:462EB311.2010508 at lexicon.net...
> It's not irrelevant; the test2 module has to be *executed* as part of
> the import. [...] seed(314) is executed.

OK, I understand this is the right answer.
But another way to look at the question is:
is it a good design to only be able to use seed
to set a global state? (See for contrast
numpy.random, for which my appreciation
has just increased yet again.)

Cheers,
Alan Isaac





More information about the Python-list mailing list