Let's say I have the following for loop:
d = defaultdict(int)
for f in foo:
for b in f:
d[b] += 1
I ripped my actual example of bloat which is unrelated to my question. Now I want to somehow shorten it. In e.g. list comprehensions we are allowed to use nested for loops, and if they're done properly they can be perfectly readable. So we reduce nesting and the amount of lines. My question here is, can we do nested for loops without doing the comprehension, so we would end with something like this, in Python?:
d[b] += 1 for b in for f in foo