Alan Isaac <[EMAIL PROTECTED]> wrote: > "John Machin" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > 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.)
What do you mean? Just instantiate the random.Random class and you can call .seed on it as well as anything else, and no other module will infringe on "your" module's Random instance. The "global functions" of module random exist for those who *SPECIFICALLY* want globally shared behavior, of course. Alex -- http://mail.python.org/mailman/listinfo/python-list