Re: random.seed question (not reproducing same sequence)

2014-04-15 Thread John Gordon
In Nick Mellor writes: > In response to your question, John, all I know is that my own code doesn't > use the random module outside of this code fragment. Does addUpdate_special_to_cart() use any random methods? In any case, a further test would be to strip out all the business logic and leav

Re: random.seed question (not reproducing same sequence)

2014-04-15 Thread Nick Mellor
Thanks John and others, Replies much appreciated. I don't know how it could affect the results, but the function being tested is using redis. And I am running the test code under PyCharm, so perhaps using the module-level random number generator wasn't such a good idea. Live and learn. In resp

Re: random.seed question (not reproducing same sequence)

2014-04-15 Thread Ned Batchelder
On 4/15/14 8:07 PM, Dan Stromberg wrote: You could easily provide your own random number generator, if you don't need cryptographic-strength random numbers. EG: http://stromberg.dnsalias.org/svn/lcgrng/trunk/lcgrng.py That way you can be certain nothing else is using it. There's no need to pu

Re: random.seed question (not reproducing same sequence)

2014-04-15 Thread Dan Stromberg
You could easily provide your own random number generator, if you don't need cryptographic-strength random numbers. EG: http://stromberg.dnsalias.org/svn/lcgrng/trunk/lcgrng.py That way you can be certain nothing else is using it. On Tue, Apr 15, 2014 at 8:54 AM, Nick Mellor wrote: > Hi guys,

Re: random.seed question (not reproducing same sequence)

2014-04-15 Thread Peter Otten
Nick Mellor wrote: > Hi guys, > > (Python 2.7, Windows 7 64-bit) > > Here's a bit of code stress-testing a method addUpdate_special_to_cart. > The test adds and updates random "specials" (multiple products bundled at > an advantageous price) of various sizes to thousands of shopping carts, > the

Re: random.seed question (not reproducing same sequence)

2014-04-15 Thread Ned Batchelder
On 4/15/14 11:54 AM, Nick Mellor wrote: Hi guys, (Python 2.7, Windows 7 64-bit) Here's a bit of code stress-testing a method addUpdate_special_to_cart. The test adds and updates random "specials" (multiple products bundled at an advantageous price) of various sizes to thousands of shopping ca

Re: random.seed question (not reproducing same sequence)

2014-04-15 Thread John Gordon
In Nick Mellor writes: > No "random" module method is used anywhere else while this code is > executing. Are you sure? How did you verify this? -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watc

random.seed question (not reproducing same sequence)

2014-04-15 Thread Nick Mellor
Hi guys, (Python 2.7, Windows 7 64-bit) Here's a bit of code stress-testing a method addUpdate_special_to_cart. The test adds and updates random "specials" (multiple products bundled at an advantageous price) of various sizes to thousands of shopping carts, then restocks the whole darn lot. Th