In <[email protected]> Nick Mellor
<[email protected]> 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 leave only the calls to random, and see if the results still differ.
Something like this:
rnd = random.Random()
for qty in [4, 0]:
print "qty is %s" % qty
rnd.seed(seed)
print "seed is %s" % seed
for cart in range(test_size):
print "cart is %s " % cart
for special in range(rnd.randrange(3)):
print "special is %s " % special
print "stockbin is %s" % rnd.randrange(test_size)
print "special_id is %s" % rnd.randrange(test_size)
print "products is %s" % [(rnd.choice(PRODUCTS),
rnd.choice(range(10))) for r in range(rnd.randrange(7))])
Run that code sample and see if the results differ when qty is 4 vs 0.
--
John Gordon Imagine what it must be like for a real medical doctor to
[email protected] watch 'House', or a real serial killer to watch 'Dexter'.
--
https://mail.python.org/mailman/listinfo/python-list