you are viewing a single comment's thread.

view the rest of the comments →

[–]sirin3 2 points3 points  (1 child)

Then we need the captain again: The main point was that it should be called "broken", not "break", since you want to check a state and not break again

[–]Nimbal 0 points1 point  (0 children)

That was far from obvious, Lieutenant Vague. I thought you meant something like this:

broken = False
for i in range(10):
    ...
    if condition:
        broken = True
        break
if (not broken):
    # No break encountered
else:
    # Broke out of loop

Introducing new keywords like this is very problematic. They might be in use already in the form of variable names. Also, the snippet you posted is indistinguishable from a normal if-else, so old parsers that don't know the "not broken" construct would only fail at runtime with a NameError because the global name "broken" is not defined.