I have a for loop in python like this:
for item in items: onwards = make_flow_decision(item) if onwards == 'break': break elif onwards == 'continue': continue elif onwards == 'carry_on': process_the_item(item)
So idea is that flow control for the loop is factored out because it is really complex.
Is there a better way of doing this than passing strings around and checking for special strings like 'continue', 'break', and 'carry_on'?
Looking for ideas generally that make this a little more elegant.