[Python-Dev] more pyref: continue in finally statements
Guido van Rossum
guido at python.org
Mon May 1 20:24:19 CEST 2006
Strange. I thought this was supposed to be fixed? (But I can confirm
that it isn't.)
BTW there's another bug in the compiler: it doesn't diagnose this
inside "while 0".
--Guido
On 5/1/06, Fredrik Lundh <fredrik at pythonware.com> wrote:
> the language reference says:
>
> continue may only occur syntactically nested in a for or while loop,
> but not nested in a function or class definition or finally statement
> within that loop. /.../
>
> It may occur within an except or else clause. The restriction on occurring
> in the try clause is implementor's laziness and will eventually be lifted.
>
> and it looks like the new compiler still has the same issue:
>
> $ python test.py
> File "test.py", line 5:
> continue
> SyntaxError: 'continue' not supported inside 'finally' clause
>
> how hard would it be to fix this ?
>
> (shouldn't the "try clause" in the note read "finally clause", btw? "continue"
> within the "try" suite seem to work just fine...)
>
> </F>
>
>
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
>
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list