Re: About python 2.5 and its try statement.



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('@')])"
.



Relevant Pages

  • (long) bsmconv / auditing questions
    ... Luckily I have my own Solaris 9 Ultra 10 to learn from ... After reading the message below I decieded to ... enable BSM to see how it works. ... has been effectively cut-off from executing several basic commands such as ...
    (SunManagers)
  • Re: panic: ffs_blkfree: freeing free block
    ... The kernel on my PC panics by reading the UPDATING-File with less after ... executing a portsnap update. ...
    (freebsd-current)
  • Re: Program Counter
    ... executing a process? ... OpenVMS V7.1-1H2 ... A worked example of following a traceback dump is available at ... Although this is aimed at reading a traceback, ...
    (comp.os.vms)
  • Re: More on Function Purity
    ... command line, the program asking the user for input, or the program ... reading values from a file. ... All of them are impure when done by ... "executing" some function, even if the values read/input don't change ...
    (comp.lang.functional)