buggy python interpretter or am I missing something here?

me noone at all.net
Mon Jan 27 01:42:21 EST 2014


On Mon, 27 Jan 2014 01:21:41 -0500, Terry Reedy wrote:

> On 1/27/2014 12:04 AM, Gary Herron wrote:
> 
>> Do
>>    try:
>>        ...
>>    except Exception,e:
>>        print e
>> at the absolute minimum.
>> (Python 3 syntax would differ slightly, but the advice is the same.)
> 
> The 'python 3' syntax
>    except Exception as e:
> works in 2.7 and perhaps 2.6. So use it unless you need compatibility
> with even earlier versions.


My point of contention isn't so much about what specific syntax I should 
be using as much as it is about being allowed to use a syntax that gives 
erroneous results without triggering a syntax violation.  If the bare 
except: clause is syntactically legal then it should yield deterministic 
results based on a well defined language specification, right?  It's 
looking very much like "except:" is undefined behaviour.

kind regards



More information about the Python-list mailing list