13 ms·
For those wondering what the hell truth() is, I think they're talking about this phenomenon: python -m timeit "if bool(1): x = 1" 1000000 loops, best of 3:
by pwf 13y ago
For those wondering what the hell truth() is, I think they're talking about this phenomenon:
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
- nemetroid 13y agotruth() is a function defined in the operator module which does kind of the same thing as bool().