adding elif to for

bob gailer bgailer at gmail.com
Tue Dec 19 18:56:10 EST 2017


Has any thought been given to adding elif to the for statement?

for x in foo:
     if y: break
elif a==b:
     something
else:
     something else

as a shortcut to:
for x in foo:
     if y: break
else:
     if a==b:
         something
else:
         something else
bob gailer



More information about the Python-list mailing list