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!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.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'operator': 0.05; '"a"': 0.09; '>>>>': 0.09; 'received:209.85.160.174': 0.09; 'received :mail-gy0-f174.google.com': 0.09; 'valueerror:': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:iterable': 0.16; 'unpack': 0.16; 'wrote:': 0.16; '(most': 0.21; 'header:In-Reply-To:1': 0.22; 'sep': 0.23; 'pm,': 0.24; 'traceback': 0.24; 'hey': 0.26; 'skip:" 30': 0.28; 'message- id:@mail.gmail.com': 0.29; 'subject:?': 0.31; 'values': 0.32; 'too': 0.33; 'to:addr:python-list': 0.33; 'last):': 0.34; 'received:209.85.160': 0.35; 'fri,': 0.36; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'subject: (': 0.39; "it's": 0.40; 'more': 0.60; 'subject:are': 0.70; 'subject:you': 0.81; 'look,': 0.84; 'otten': 0.84; 'subject:Best': 0.93 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=CQykWV1wAr/3kD4xI7BNCIsHFFyH6EzXBarYWYnDFOo=; b=woka8akcDcej/6qNRm11I2Jt3Nk078pfzRg80otj3DB5nyVcyX0TddlELlQ7t2bVjl 1u5qYcdH+nHZnA4ZNPYy9Nk2Sht1kxzijyrnK54u2xBqmXnBd5QU5hkgKtp+/74mJd1h DjmGcMZJ0HkQ49bMDvpPxg3Qkk9txZIPikPaw= MIME-Version: 1.0 In-Reply-To: References: <264a83d7-aa43-4e36-b39e-3e67488279b6@glegroupsg2000goo.googlegroups.com> Date: Fri, 9 Sep 2011 21:30:03 +1000 Subject: Re: Best way to check that you are at the beginning (the end) of an iterable? From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1315567806 news.xs4all.nl 2527 [2001:888:2000:d::a6]:59223 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:13018 On Fri, Sep 9, 2011 at 9:04 PM, Peter Otten <__peter__@web.de> wrote: >>>> [x] =3D "" > Traceback (most recent call last): > =A0File "", line 1, in > ValueError: need more than 0 values to unpack >>>> [x] =3D "a" >>>> [x] =3D "ab" > Traceback (most recent call last): > =A0File "", line 1, in > ValueError: too many values to unpack > Hey look, it's a new operator - the "assign-sole-result-of-iterable" operat= or! x ,=3D "a" :) ChrisA