break LABEL vs. exceptions + PROPOSAL
looris at gmail.com
Thu Nov 19 11:38:34 CET 2009
On Nov 18, 7:13 pm, Terry Reedy <tjre... at udel.edu> wrote:
> 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
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.
More information about the Python-list