My code above go through the whole <code>iterable</code> once.
If I used <code>return sum(1 for x in iterable if f(x))</code>, then I would generate a list with the for comprehension that is one pass, and then sum the ones which is:
1) equivalent to <code>return len(1 for x in iterable if f(x))</code>
2) another pass

That would make this solution two times slower.