Is there a way to evaluate an expression in python and break from a loop in the same time?
Easiest example to explain what I have in mind:
while True:
if bar == 'baz':
foo = bar == 'baz'
break
But that's programmerhorror and I wanted to do something along the lines (maybe with lambda function?):
while True:
foo = bar == 'baz' # and in the same line call break, but only if bar equals baz