gotcha or bug? random state reset on irrelevant import

Alan Isaac aisaac at american.edu
Tue Apr 24 21:22:07 EDT 2007


Running test.py will print False.
Is this expected/desirable?
Thanks,
Alan Isaac


%%%%%%% test.py %%%%%%%%%%%
from random import seed, getstate
seed(217)
x = getstate()
from test2 import Trivial
y = getstate()
print x == y


%%%%%  test2.py  %%%%%%%%%%%%%
from random import seed
seed(314)
class Trivial:
    pass






More information about the Python-list mailing list