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


Groups > comp.lang.python > #19607

Re: except clause syntax question

Date 2012-01-30 18:56 +0100
From Aaron <aaron.l.france@gmail.com>
Subject Re: except clause syntax question
References <E1A3D6A5-CCE8-4D87-82E0-938159D0CE61@declareSub.com>
Newsgroups comp.lang.python
Message-ID <mailman.5219.1327946266.27778.python-list@python.org> (permalink)

Show all headers | View raw


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?

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


Thread

Re: except clause syntax question Aaron <aaron.l.france@gmail.com> - 2012-01-30 18:56 +0100

csiph-web