[python] using try: finally: except

OKB (not okblacke) BrenBarn at aol.com
Sat Jun 19 03:15:00 CEST 2004

Carl Banks wrote:

> The right way is:
>     try:
>         try:
>             x = 'hello'
>         except:
>             print "oops"
>     finally:
>         y = 'world'
>         print x," ",y

    	I seem to recall reading somewhere that this was a cop-out for some 
implementation reason.  Is there any word on when or if it's going to be 
remedied?  It seems unbearably ugly and unintuitive; one of the most 
irritating Python warts.

--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead.  Go, instead, where there is
no path, and leave a trail."
	--author unknown

More information about the Python-list mailing list