I accept that, due to language limitation, continue
must be within a loop “properly” i.e. “not nested in a function or class definition within that loop.”
while True:
def f():
continue # SyntaxError: 'continue' not properly in loop
f()
What’s the significance of the difference at break
, where the complaint is that it is “outside” loop?
while True:
def f():
break # SyntaxError: 'break' outside loop
f()
I see no relevant difference in the language reference.