I just came across this piece of code
while 1: line = data.readline() if not line: break #...
and thought, there must
According to the FAQ from Python's documentation, iterating over the input with for construct or running an infinite while True loop and using break statement to terminate it, are preferred and idiomatic ways of iteration.
for
while True
break