[Python-bugs-list] Syntax (PR#177)
Skip Montanaro
skip@mojam.com (Skip Montanaro)
Tue, 11 Jan 2000 11:34:26 -0600 (CST)
Simon> I don't know if this is a bug, or is intentional behaviour for a
Simon> specific reason.
Simon> The following code produces a syntax error about the continue not
Simon> being within a looping structure rather than a prefectly silly
Simon> infinite loop...
Simon> while 1:
Simon> try:
Simon> continue
Simon> except:
Simon> pass
Continue, break and return within try clauses are not allowed. It's a
known limitation of the implementation. The language reference manual
states:
A continue statement is illegal in the try clause. (The reason is a
problem with the current implementation -- this restriction may be
lifted in the future).
Skip Montanaro | http://www.mojam.com/
skip@mojam.com | http://www.musi-cal.com/
847-971-7098