Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19608

Re: except clause syntax question

Subject Re: except clause syntax question
From Charles Yeomans <charles@declareSub.com>
Date 2012-01-30 13:56 -0500
References <E1A3D6A5-CCE8-4D87-82E0-938159D0CE61@declareSub.com> <4F26D9C7.6020109@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.5220.1327949774.27778.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: except clause syntax question Charles Yeomans <charles@declareSub.com> - 2012-01-30 13:56 -0500

csiph-web