from timeit import Timer
VALUE = 1
def bool_test():
return bool(VALUE)
def not_not_test():
return not not VALUE
def and_or_test():
return VALUE and True or False
if __name__ == '__main__':
print Timer('bool_test()', 'from __main__ import bool_test').timeit()
print Timer('not_not_test()', 'from __main__ import not_not_test').timeit()
print Timer('and_or_test()', 'from __main__ import and_or_test').timeit()