change of random state when pyc created??

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue May 8 22:52:07 EDT 2007


En Tue, 08 May 2007 14:59:27 -0300, Alan Isaac <aisaac at american.edu>  
escribió:

> What I have seen is:
>
>       - when a test1.pyc file is present, I always get the
>         same outcome (result1)
>       - when a test1.pyc file is NOT present, I always get
>         the same outcome (result2)
>       - the two outcomes are different (result1 != result2)

I've logged all Random calls (it appears to be only one shuffle call,  
after the initial seed) and in both cases they get the same numbers. So  
the program always starts with the same "shuffled" values.

Perhaps there is a tiny discrepancy in the marshal representation of some  
floating point values. When there is no .pyc, Python parses the literal  
 from source; when a .pyc is found, Python loads the value from there; they  
could be slightly different.
I'll investigate further... tomorrow.

-- 
Gabriel Genellina




More information about the Python-list mailing list