[Python-bugs-list] Syntax (PR#177)
tim_one@email.msn.com
tim_one@email.msn.com
Tue, 11 Jan 2000 12:09:59 -0500 (EST)
[Simon Barratt, putting "continue" in a "try" block]
> I don't know if this is a bug, or is intentional behaviour
> for a specific reason.
Actually, it's a bit of both <wink>. See the Language Reference Manual's
section on the "continue" statement, particularly the footnote:
The restriction on occurring in the try clause is
implementer's laziness and will eventually be lifted.
It's been this way (and documented) forever; it's simply hard to implement
given the current structure of the interpreter loop.
Rest assured there's nothing *conceptually* wrong with putting continue in a
try! It's simply an implementation restriction; the error msg should
probably make that clearer. IIRC, JPython doesn't have this restriction.
"Someday" it will get repaired in CPython too.