break LABEL vs. exceptions + PROPOSAL

Terry Reedy tjreedy at
Wed Nov 18 19:13:11 CET 2009

Chris Rebert wrote:
> On Wed, Nov 18, 2009 at 4:05 AM, Lo'oris <looris at> wrote:
>> I've found this email, back from 10 years ago:
>> I guess it went unnoticed, because that proposal looks really
>> intresting.

I think it went unnoticed because it is not very good, once looked at.
>> • break labels have been refused into python
>> • we can do it anyway using exceptions

So the proposal is not needed

>> • this is a proposal for something better, resembling "the exception
>> way" and much more powerful and python-like than break labels

It amounts to duplicating raise x...exception x as break x....continue x 
in the name of aesthetics and supposed efficiency. There would be no new 
functionality nor any abbreviation of code. The semantics of 
break/continue as specific loop subcommands would be changed to 'use 
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.

Anyway, I think the example given would be better written with immediate 
assignment followed by simple break, rather than the proposed delayed 

The exception example as given would have to be rewritten to work in 3.x.

> You're gonna have to wait 18-24 months:
> Also, the python-ideas list might be a better forum for discussing
> this than the general-interest list:

This is a fine place to discuss it.

Terry Jan Reedy

More information about the Python-list mailing list