Hacker News new | ask | show | jobs
by pwf 4693 days 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
1 comments

truth() is a function defined in the operator module which does kind of the same thing as bool().