On Tue, 15 Nov 2011 14:22:21 -0800, Chris Kaynor wrote:

> The tests (the code is shown later - its about 53 lines, with lots of
> copy+paste...):

Holy unnecessarily complicated code Batman!

This is much simpler:

[steve@ando ~]$ python -m timeit -s "x = None" "if x is None: pass"
10000000 loops, best of 3: 0.0738 usec per loop
[steve@ando ~]$ python -m timeit -s "x = True" "if x is None: pass"
10000000 loops, best of 3: 0.0799 usec per loop

The difference is too small to be significant. If I run the same tests 
multiple times, the winner could easily change.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to