change of random state when pyc created??

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Thu May 10 01:33:46 EDT 2007


On Thu, 10 May 2007 01:06:33 -0400, Carsten Haese wrote:

> On Thu, 10 May 2007 12:46:05 +1000, Steven D'Aprano wrote
>> It is natural to expect two runs of any program to give the same 
>> result if there are (1) no random numbers involved; (2) the same 
>> input data; (3) and no permanent storage from run to run.
> 
> Which of those three categories does time.time() fall into? What about
> id("hello")?

I didn't say there were no exceptions to the heuristic "expect any
computer program to do the same thing on subsequent runs". I said it was a
natural expectation.

Obviously one of the differences between a naive programmer and a
sophisticated programmer is that the sophisticated programmer has learnt
more exceptions to the rule.

And that's why I have described this behaviour as a gotcha, not as a bug
or a mis-feature or anything else.


-- 
Steven.




More information about the Python-list mailing list