In article <[EMAIL PROTECTED]>, Ray <[EMAIL PROTECTED]> wrote: > >2. I'm quite baffled that you either have try/except, or try/finally. >In Java, it is quite common to do this: > >try { > // something >} catch(AException e) { > // handle >} catch(BException e) { > // handle >} catch(CException e) { > // handle >} finally { > // whatever happens, execute this >} > >It seems that since except and finally are mutually exclusive I can't >do this. So... what's the usual idiom for this?
Keep in mind that Python actually predates Java. The way this is handled now is try: try: except: else: finally: Way back when, Guido thought that it would be confusing to allow both except and finally clauses in the same try because people wouldn't know what ordering to use (particularly with the else clause). -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ The way to build large Python applications is to componentize and loosely-couple the hell out of everything. -- http://mail.python.org/mailman/listinfo/python-list