Slight irritation with try/finally indentation

Alex Martelli aleax at aleax.it
Sat May 4 12:38:22 EDT 2002


François Pinard wrote:

> [Stephen J. Turnbull]
        ...
>>     try:
>>         setup()
>>         process()
>>     except SetupError:
>>         pass
>>     else:
>>         cleanup()
> 
> Clever, and nice.  Thanks for this idea, I'll ponder it.

But this only calls cleanup if process does NOT raise.  NOT the same
semantics as a try/finally *at all*!

What am I missing...?


Alex




More information about the Python-list mailing list