Being able to break multiple loops and having "labelled"
breaks would be achievable using `except`, i.e. adding
`except` to the loop statements before `else` like this:
for elem in iterable:
...
if should_break(elem):
raise SomeException
except SomeException as e:
handle_break_behaviour(e)
else:
print("Did not break")
would be sugar for:
try:
for elem in iterable:
...
if should_break(elem):
raise SomeException
except SomeException as e:
handle_break_behaviour(e)
else:
print("Did not break")
I (and others) have suggested this before and no one has
said it's a bad option, it's just been ignored,
despite seeming to be an intuitive way to accomplish `else`
clarity, "labelled" breaks and breaking from multiple loops.
Is there a reason that this suggestion is worse / no better
than adding special break syntax?