break LABEL vs. exceptions + PROPOSAL

2009-11-18 Thread Lo';oris
I've found this email, back from 10 years ago:
http://mail.python.org/pipermail/python-list/1999-September/009983.html

I guess it went unnoticed, because that proposal looks really
intresting.

• break labels have been refused into python
• we can do it anyway using exceptions
• this is a proposal for something better, resembling "the exception
way" and much more powerful and python-like than break labels
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: break LABEL vs. exceptions + PROPOSAL

2009-11-20 Thread Lo';oris
On Nov 18, 7:13 pm, Terry Reedy  wrote:
> It amounts to duplicating raise x...exception x as break xcontinue x
> in the name of aesthetics and supposed efficiency. There would be no new
> functionality nor any abbreviation of code. The semantics of

there would be abbreviation: you wouldn't have to declare somewhere a
dummy exception class.

> anyplace'. The OP gives as a reason the possibility of a typo creating a
> raise x ... except y mis-match. But a break x ... continue y mismatch is
> equally likely.

no: if you mismatch a label in this case, it should be treated as a
syntax error, not as an
unhandled exception which you might not notice.
-- 
http://mail.python.org/mailman/listinfo/python-list