Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100416

Re: Why is break allowed in finally, but continue is not?

Newsgroups comp.lang.python
Date 2015-12-14 09:37 -0800
References <b976659a-a7e0-40b4-b74b-2b3689e64d5c@googlegroups.com> <mailman.222.1450045698.12405.python-list@python.org>
Message-ID <c6ede47c-7e3e-4ef3-850c-4363fe936133@googlegroups.com> (permalink)
Subject Re: Why is break allowed in finally, but continue is not?
From Ned Batchelder <ned@nedbatchelder.com>

Show all headers | View raw


On Sunday, December 13, 2015 at 5:28:44 PM UTC-5, Ben Finney wrote:
> Ned Batchelder <ned@nedbatchelder.com> writes:
> > So why treat 'continue' specially?
> 
> I am inclined to agree, but in the opposite direction: a case should be
> made for allowing *any* flow-control statement in an exception-handler's
> 'finally' clause.

I agree, those all seem like bad ideas.  But 'continue' has been singled
out for a SyntaxError.  Rumor has it that continue was difficult to make
work at all, while the other keywords, while ill-advised, were at least
possible.

--Ned.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Why is break allowed in finally, but continue is not? Ned Batchelder <ned@nedbatchelder.com> - 2015-12-13 13:10 -0800
  Re: Why is break allowed in finally, but continue is not? Ben Finney <ben+python@benfinney.id.au> - 2015-12-14 09:27 +1100
    Re: Why is break allowed in finally, but continue is not? Ned Batchelder <ned@nedbatchelder.com> - 2015-12-14 09:37 -0800
      Re: Why is break allowed in finally, but continue is not? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-14 18:40 +0000

csiph-web