else: w/o except: - why not?

Erik Max Francis max at alcyone.com
Wed Apr 2 00:20:05 CEST 2003


Jeremy Fincher wrote:

> Wouldn't that be better written like thiS?
> 
> try:
>   f1()
> finally:
>   f2()

No, that means something different.  The finally clause _always_ gets
executed; the except clause only gets executed if an exception occurs.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ A good indignation brings out all one's powers.
\__/ Ralph Waldo Emerson
    Esperanto reference / http://www.alcyone.com/max/lang/esperanto/
 An Esperanto reference for English speakers.




More information about the Python-list mailing list