• Saleh@feddit.org
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    5 hours ago

    Couldn’t you just handle this with:

    
    breakflag = False
    
    for x in iterator:
    
         if breakcondition(x):
                breakflag = True
                break  
         dostuff()