```python n = 0 class Test: def __bool__(self): global n n += 1 return False Test() and False or False assert n == 1 ``` CPython optimizes this check in: https://github.com/python/cpython/blob/54ab9ad312ea53db40e31712454272e1d4c0315f/Python/compile.c#L8708-L8721