[python] using try: finally: except
peter at engcorp.com
Sat Jun 19 03:33:18 CEST 2004
OKB (not okblacke) wrote:
> Carl Banks wrote:
>>The right way is:
>> x = 'hello'
>> print "oops"
>> 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.
I recall differently. I recall reading several times that since
it is completely ambiguous what the programmer meant if both are
specified together, Guido deliberately kept them separate so that
one had to be very explicit about whether the finally was inside
or outside the except. The behaviour of the code is quite different
depending on the order...
More information about the Python-list