Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '>>>>': 0.09; 'args,': 0.09; 'be:': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'raised.': 0.09; 'received:gator410.hostgator.com': 0.09; 'tuple': 0.09; 'valueerror:': 0.09; '~ethan~': 0.09; 'subject:error': 0.09; '"expected': 0.16; 'a,b,c': 0.16; 'benjamin': 0.16; 'iterable,': 0.16; 'received:72.11': 0.16; 'received:72.11.125': 0.16; 'received:72.11.125.166': 0.16; 'rhs': 0.16; 'unpack': 0.16; 'unpacking': 0.16; 'wrote:': 0.18; '>>>': 0.18; 'this?': 0.19; '(most': 0.21; 'so.': 0.22; 'dec': 0.22; "doesn't": 0.22; 'header :In-Reply-To:1': 0.22; 'items.': 0.23; 'traceback': 0.24; 'helpful': 0.26; 'lists': 0.28; 'pm,': 0.29; 'values': 0.32; 'returning': 0.32; 'thu,': 0.32; 'header:User-Agent:1': 0.33; 'instead': 0.33; 'there': 0.33; 'to:addr:python-list': 0.34; 'probably': 0.34; 'last):': 0.34; 'file': 0.36; 'but': 0.37; 'list,': 0.37; 'could': 0.37; 'to:addr:python.org': 0.40; 'more': 0.61; '2011': 0.61; 'stop': 0.63; 'received:websitewelcome.com': 0.64; 'received:184': 0.67; 'subject:day': 0.68 Date: Thu, 08 Dec 2011 12:09:11 -0800 From: Ethan Furman User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: python-list@python.org Subject: Re: Misleading error message of the day References: <18647617.2258.1323358966076.JavaMail.geo-discussion-forums@yqf20> <3164448.1087.1323369765528.JavaMail.geo-discussion-forums@yqcm37> <4EE10B63.2010600@stoneleaf.us> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator410.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: mail.admailinc.com ([192.168.10.136]) [72.11.125.166]:3178 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3I0MTAuaG9zdGdhdG9yLmNvbQ== 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1323376541 news.xs4all.nl 6971 [2001:888:2000:d::a6]:45919 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16872 Benjamin Kaplan wrote: > On Thu, Dec 8, 2011 at 2:09 PM, Ethan Furman wrote: >> Benjamin Kaplan wrote: >>> If the RHS was a tuple or a list, yes you could know immediately. But >>> unpacking works with any iterable, so it probably doesn't special-case >>> lists and tuples. Iterables don't have a size- they just keep going >>> until StopIteration is raised. So in EVERY SINGLE CASE, you would get >>> "expected n args, got n+1" even if the iterable would return 24 items >>> instead of 14, or would never stop returning items. >> >> Not so. There could be fewer, in which you could see "expected 13 args, got >> 7." >> > > You mean like this? > >>>> a,b,c = ['a','b'] > Traceback (most recent call last): > File "", line 1, in > ValueError: need more than 2 values to unpack This is still not as helpful as this would be: ValueError: need 3 values, received 2 ~Ethan~