except clause syntax question
Charles Yeomans
charles at declareSub.com
Mon Jan 30 13:56:07 EST 2012
On Jan 30, 2012, at 12:56 PM, Aaron wrote:
> On 01/30/2012 06:41 PM, Charles Yeomans wrote:
>> To catch more than one exception type in an except block, one writes
>>
>> except (A, B, C) as e:
>>
>> I'm wondering why it was decided to match tuples, but not lists:
>>
>> except [A, B, C] as e:
>>
>> The latter makes more sense semantically to me -- "catch all exception types in a list" as opposed to "catch this single thing composed of three exception types".
>>
>>
>> Charles Yeomans
>>
>>
>
> Then, semantically, shouldn't it be a set?
Why, I suppose that would make even more sense.
Charles Yeomans
More information about the Python-list
mailing list