I have a lazy iterator/generator a which is doing some side-effect on each iteration and I don't care about the values that it produces. What is the most idiomatic way to evaluate the side effects? Of course, I can simply do:
for _ in a: pass
But it seems rather ugly.
map()invoked for the side effects of the function; the correct transformation is to use a regular for loop (since creating a list would just be wasteful)."all(a). If it always yields falsy values:any(a).