Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed20.multikabel.net!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.081 X-Spam-Evidence: '*H*': 0.84; '*S*': 0.00; 'exception': 0.12; 'block,': 0.16; 'semantically': 0.16; 'subject:syntax': 0.16; 'tuples,': 0.16; 'subject:question': 0.16; 'wrote:': 0.16; 'header :In-Reply-To:1': 0.22; "shouldn't": 0.23; 'received:74.125.82.174': 0.24; 'pm,': 0.26; "i'm": 0.27; 'list"': 0.30; 'message-id:@gmail.com': 0.33; 'header:User-Agent:1': 0.33; 'to:addr:python-list': 0.33; 'match': 0.33; 'wondering': 0.34; 'latter': 0.34; 'received:74.125.82': 0.34; 'opposed': 0.36; 'but': 0.37; 'received:74.125': 0.37; 'received:google.com': 0.37; 'received:192': 0.38; 'why': 0.39; 'except': 0.39; 'sense': 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.40; 'type': 0.60; 'types': 0.61; 'more': 0.61; 'charles': 0.67; 'lists:': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=C4CpuqGjO+dvOf3BHPwlFhliP2i56pIIj++lrOWpvYw=; b=v6/YoW2bD8BHVwSxwKl6nnZ4UWrFK+kn0Zgl9oyxUPV9aaHHu70sDh0ldBEhkqN77d qgcJnUbI79ABhS92pBo8smlUQN8fPWhHUR5kveEhI2H3zFuaT8omoXwwLh6Q6EMqEwyI UKtDqPjGfArvjGfB0IEF1b/WhVsEL5rbLUl+c= Date: Mon, 30 Jan 2012 18:56:23 +0100 From: Aaron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111224 Thunderbird/9.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: except clause syntax question References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1327946266 news.xs4all.nl 6949 [2001:888:2000:d::a6]:60136 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19607 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?