try...finally is more powerful than I thought.
Peter Hansen
peter at engcorp.com
Fri Nov 7 23:07:36 EST 2003
Lee Harr wrote:
>
> On 2003-11-07, Peter Hansen <peter at engcorp.com> wrote:
> > Lee Harr wrote:
> >> interesting.
> >
> > Why? It just proves that "finally" works, and
> > executes when the return statement is encountered.
>
> Yes. I just found the entire thread interesting. I know that
> people who are unfamiliar with the try ... finally syntax can
> easily fire up the interpreter and play around with it for
> themselves, but I thought the "basic functionality" example
> might make the rest of the thread more clear.
>
> I have written a lot of python code and have never used finally.
Ah, good point. :-)
-Peter
More information about the Python-list
mailing list