Re: About python 2.5 and its try statement.
- From: Bruno Desthuilliers <onurb@xxxxxxxxxxx>
- Date: Mon, 26 Jun 2006 14:50:41 +0200
defcon8 wrote:
I can't remember the proposal number,
http://docs.python.org/dev/whatsnew/pep-341.html
but many of you reading will have
probably read the features that will be added to python 2.5. The actual
part I wanted to talk about was the finally part of try.
It has been here from the start (well, IIRC, it's since at least 1.5.2)
- the only limitation was that you couldn't use both 'except' and
'finally' in the same statement, so you had to wrap'em when needed.
Isn't it
totally defeating a compiler's job by executing the finally part even
if there is an error in the previous statements?
I don't see how this relates to the compiler. But anyway, the whole
point of the 'finally' clause is (and has ever been) to *ensure* this
block gets executed *whatever* happened. FWIW, the canonical use case is
resource aquisition/release.
Or have I understood
something wrong?
Seems so - unless it's me misunderstading your question.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb@xxxxxxxxxxx'.split('@')])"
.
- References:
- About python 2.5 and its try statement.
- From: defcon8
- About python 2.5 and its try statement.
- Prev by Date: Help with conversion VB script to Python : COM objects
- Next by Date: automatic debugger?
- Previous by thread: Re: About python 2.5 and its try statement.
- Next by thread: Re: About python 2.5 and its try statement.
- Index(es):
Relevant Pages
|
|