On 8/22/2011 9:35 AM Emile van Sebille said...
On 8/22/2011 2:55 AM Richard D. Moores said...
Coincidence?
Naaa.. I just ran it twice -- once per ... _this_ is coincidence. :)
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Emile>python -m timeit -r 3 -s "n=0" "n=n+1"
10000000 loops, best of 3: 0.108 usec per loop
C:\Documents and Settings\Emile>python -m timeit -r 3 -s "n=0" "n += 1"
10000000 loops, best of 3: 0.108 usec per loop
Actually, it's more likely I hit a minimum resolution issue -- I ran it
twenty more times and never got a different result.
Emile
--
http://mail.python.org/mailman/listinfo/python-list