#Python istas: there is
with open(file, 'r') as f:
for line in f:
line = line.strip() # <this>
dostuff(line) # example
Is there a way to inline <this> somehow somewhere in the code part before dostuff(), so that I iterate over lines in f and have a pre-stripped line variable at hand right away to do stuff with?