Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'correct.': 0.09; 'to:addr:comp.lang.python': 0.09; 'valueerror:': 0.09; 'subject:error': 0.09; 'exception': 0.12; ':o)': 0.16; 'iterable,': 0.16; 'roy': 0.16; 'unpacking': 0.16; 'cc:addr :python-list': 0.16; 'wrote:': 0.18; 'cc:no real name:2**0': 0.20; 'otherwise.': 0.21; 'header:In-Reply-To:1': 0.22; 'equally': 0.23; 'string': 0.24; 'saying': 0.26; "i'm": 0.26; 'cc:addr:python.org': 0.29; 'error': 0.29; 'correct': 0.29; 'header:User-Agent:1': 0.33; 'there': 0.33; 'agree': 0.33; 'probably': 0.34; 'message.': 0.34; 'something': 0.35; 'cc:2**1': 0.36; 'thread': 0.37; 'thursday,': 0.37; 'but': 0.37; 'could': 0.37; 'useful': 0.38; 'should': 0.39; "it's": 0.40; 'more': 0.61; '2011': 0.61; 'subject:day': 0.68; 'received:62': 0.70; 'exposed.': 0.84; 'dark': 0.91 X-IronPort-AV: E=Sophos;i="4.71,321,1320620400"; d="scan'208";a="36674" X-Virus-Scanned: amavisd-new at zimbra.sequans.com Date: Thu, 08 Dec 2011 20:49:54 +0100 From: Jean-Michel Pichavant User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) MIME-Version: 1.0 To: comp.lang.python@googlegroups.com Subject: Re: Misleading error message of the day References: <27000242.1109.1323358430515.JavaMail.geo-discussion-forums@yqny18> In-Reply-To: <27000242.1109.1323358430515.JavaMail.geo-discussion-forums@yqny18> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: python-list@python.org, Roy Smith 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1323373798 news.xs4all.nl 6953 [2001:888:2000:d::a6]:38764 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16865 Roy Smith wrote: > On Thursday, December 8, 2011 10:03:38 AM UTC-5, Jean-Michel Pichavant wrote: > >> string are iterable, considering this, the error is correct. >> > > Yes, I understand that the exception is correct. I'm not saying the exception should be changed, just that we have the opportunity to produce a more useful error message. The exception would be equally correct if it was: > > ValueError: you did something wrong > > but most people would probably agree that it's not the most useful message that could have been produced. > You have to opportunity to not use unpacking anymore :o) There is a recent thread were the dark side of unpacking was exposed. Unpacking is a cool feautre for very small applications but should be avoided whenever possible otherwise. JM