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


Groups > comp.lang.python > #16831

Re: Misleading error message of the day

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python': 0.08; '>>>>': 0.09; 'beating': 0.09; 'valueerror:': 0.09; 'subject:error': 0.09; 'am,': 0.12; 'received:209.85.210.174': 0.13; 'received:mail- iy0-f174.google.com': 0.13; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'roy': 0.16; 'unpack': 0.16; 'worse.': 0.16; 'language': 0.17; 'wrote:': 0.18; '(most': 0.21; 'dec': 0.22; 'header:In-Reply-To:1': 0.22; 'though.': 0.23; 'string': 0.24; 'traceback': 0.24; 'language.': 0.28; 'message- id:@mail.gmail.com': 0.28; 'looks': 0.29; 'values': 0.32; 'wondering': 0.32; "isn't": 0.33; 'rather': 0.33; 'fri,': 0.34; 'to:addr:python-list': 0.34; 'too': 0.34; 'last):': 0.34; 'issue': 0.35; 'something': 0.35; 'received:google.com': 0.37; 'spent': 0.38; 'received:209.85': 0.38; 'received:209': 0.40; 'to:addr:python.org': 0.40; '2011': 0.61; 'your': 0.61; 'subject:day': 0.68; "'foo'": 0.84; 'facility,': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=57SnyMvfvIN9MSCavBjuNCsHY2UdlGWGF1qqeHOmzNY=; b=JFNU9KM7DXibNhS9Py+5ladRKBXYD9KktMhfYP8jl7dcdE48dTaAuS3y8ZXcK3ZwPl GBKrKC0jcAQDch+TPkglYidLRxLsDihOGJO3i9jLNmKSBlEmBH7XOIHwSOe4ICjBJmu6 wVR3Tp5zCBcb1MYZLb4PJz4Z45YDwckPsHChU=
MIME-Version 1.0
In-Reply-To <roy-9DEDD9.09233308122011@news.panix.com>
References <roy-9DEDD9.09233308122011@news.panix.com>
Date Fri, 9 Dec 2011 01:40:53 +1100
Subject Re: Misleading error message of the day
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3413.1323355255.27778.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1323355255 news.xs4all.nl 6876 [2001:888:2000:d::a6]:51667
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:16831

Show key headers only | View raw


On Fri, Dec 9, 2011 at 1:23 AM, Roy Smith <roy@panix.com> wrote:
> I just spent a while beating my head against this one.
>
> # Python 2.6
>>>> a, b = 'foo'
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> ValueError: too many values to unpack

Definitely weird! I smell a job for a linter though. If you had just
happened to have a two-character string there, it would have quietly
succeeded, and left you wondering what was going on - imho rather
worse.

This isn't something for the language to solve; the same issue would
come up if you had something like:

a=[1,2,3]
b=[4,5,6]

c,d=a # oops, mucked up the "a,b" side

Or any other iterable. Looks to me like a chance for an informational
note from your lint facility, not a change to the language.

ChrisA

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


Thread

Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-08 09:23 -0500
  Re: Misleading error message of the day Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-12-08 14:39 +0000
  Re: Misleading error message of the day Chris Angelico <rosuav@gmail.com> - 2011-12-09 01:40 +1100
  Re: Misleading error message of the day Robert Kern <robert.kern@gmail.com> - 2011-12-08 14:47 +0000
    Re: Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-08 07:30 -0800
      Re: Misleading error message of the day Tim Chase <python.list@tim.thechases.com> - 2011-12-08 11:41 -0600
    Re: Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-08 07:30 -0800
  Re: Misleading error message of the day Jean-Michel Pichavant <jeanmichel@sequans.com> - 2011-12-08 16:03 +0100
    Re: Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-08 07:33 -0800
      Re: Misleading error message of the day Jean-Michel Pichavant <jeanmichel@sequans.com> - 2011-12-08 20:49 +0100
      Re: Misleading error message of the day Ethan Furman <ethan@stoneleaf.us> - 2011-12-08 12:13 -0800
      Re: Misleading error message of the day Lie Ryan <lie.1296@gmail.com> - 2011-12-09 12:46 +1100
        Re: Misleading error message of the day alex23 <wuwei23@gmail.com> - 2011-12-08 20:57 -0800
          Re: Misleading error message of the day Lie Ryan <lie.1296@gmail.com> - 2011-12-11 10:41 +1100
      Re: Misleading error message of the day Jean-Michel Pichavant <jeanmichel@sequans.com> - 2011-12-09 11:03 +0100
        Re: Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-09 09:43 -0500
      Re: Misleading error message of the day Ethan Furman <ethan@stoneleaf.us> - 2011-12-09 09:39 -0800
    Re: Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-08 07:33 -0800
      Re: Misleading error message of the day Grant Edwards <invalid@invalid.invalid> - 2011-12-08 18:10 +0000
        Re: Misleading error message of the day alister <alister.ware@ntlworld.com> - 2011-12-08 20:58 +0000
          Re: Misleading error message of the day Chris Angelico <rosuav@gmail.com> - 2011-12-09 08:17 +1100
        Re: Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-08 20:19 -0500
        Re: Misleading error message of the day Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-09 02:07 +0000
          Re: Misleading error message of the day Chris Angelico <rosuav@gmail.com> - 2011-12-09 14:46 +1100
            Re: Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-08 23:44 -0500
  Re: Misleading error message of the day Heiko Wundram <modelnine@modelnine.org> - 2011-12-08 16:16 +0100
    Re: Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-08 07:42 -0800
      Re: Misleading error message of the day Heiko Wundram <modelnine@modelnine.org> - 2011-12-08 16:50 +0100
        Re: Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-08 10:42 -0800
          Re: Misleading error message of the day Benjamin Kaplan <benjamin.kaplan@case.edu> - 2011-12-08 13:57 -0500
          Re: Misleading error message of the day Ethan Furman <ethan@stoneleaf.us> - 2011-12-08 11:09 -0800
          Re: Misleading error message of the day Benjamin Kaplan <benjamin.kaplan@case.edu> - 2011-12-08 14:38 -0500
          Re: Misleading error message of the day Ethan Furman <ethan@stoneleaf.us> - 2011-12-08 12:09 -0800
        Re: Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-08 10:42 -0800
      Re: Misleading error message of the day Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-12-08 15:55 +0000
      Re: Misleading error message of the day Chris Angelico <rosuav@gmail.com> - 2011-12-09 03:21 +1100
      Re: Misleading error message of the day Robert Kern <robert.kern@gmail.com> - 2011-12-08 19:57 +0000
    Re: Misleading error message of the day Roy Smith <roy@panix.com> - 2011-12-08 07:42 -0800

csiph-web