GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing mail.python.org — [Python-Dev] Fwd: try...else [Python-Dev] Fwd: try...elseMichael Hudson [email protected]Thu, 28 Dec 2000 18:27:48 +0000 (GMT)
On Thu, 28 Dec 2000, M.-A. Lemburg wrote:
> I think Robin mixed up try...finally with try...except...else.
I think so too.
> The finally clause is executed even in case an exception occurred.
>
> He does have a point however that 'return' will bypass
> try...else and try...finally clauses. I don't think we can change
> that behaviour, though, as it would break code.
return does not skip finally clauses[1]. In my not especially humble
opinion, the current behaviour is the Right Thing. I'd have to think for
a moment before saying what Robin's example would print, but I think the
alternative would disturb me far more.
Cheers,
M.
[1] In fact the flow of control on return is very similar to that of an
exception - ooh, look at that implementation...
|
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |