Why is truth() faster than bool() in Python?
tellaparteng.tumblr.com
tellaparteng.tumblr.com
* bool() takes one optional and named argument, and
* truth() takes one argument.
python -m timeit "if bool(1): x = 1"
1000000 loops, best of 3: 0.187 usec per loop
python -m timeit "if 1: x = 1"
10000000 loops, best of 3: 0.0266 usec per loop