[Python-Dev] Pre-PEP: Unifying try-except and try-finally

Reinhold Birkenfeld reinhold-birkenfeld-nospam at wolke7.net
Wed May 4 22:28:23 CEST 2005


Tim Peters wrote:
> [Reinhold Birkenfeld]
>> ...
>> I think the behaviour of the "else" clause is much harder to guess,
>> mainly when used with the looping constructs.
> 
> No, that's obvious <wink>.

OK, I'm persuaded. Well you wield the Force, master.

> What about `else` mixed with try/except/finally?
> 
> try:
>     A
> except:
>     B
> else:
>     C
> finally:
>     D
> 
> If A executes without exception, does D execute before or after C?

Given the order of the clauses, is it so ambiguous?

Reinhold

-- 
Mail address is perfectly valid!



More information about the Python-Dev mailing list