Alan Isaac wrote:
> 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
> 
> 
> 

Yes. To circomvent this, use

from random import seed

class Trivial:
   pass

if __name__ == "__main__":
   seed(314)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to