Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!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.036 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'problem:': 0.09; 'am,': 0.12; 'cc:addr:python-list': 0.16; 'mon,': 0.16; 'wrote:': 0.16; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.22; 'header:In-Reply- To:1': 0.22; 'body.': 0.23; 'exhibit': 0.23; 'sep': 0.23; 'function': 0.27; 'message-id:@mail.gmail.com': 0.29; 'cc:addr:python.org': 0.30; 'example': 0.30; 'kelly': 0.30; 'received:209.85.161.46': 0.31; 'received:mail- fx0-f46.google.com': 0.31; 'does': 0.32; "can't": 0.33; 'subject:next': 0.34; 'received:209.85.161': 0.35; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'under': 0.39; 'called': 0.40; 'your': 0.61; '10:55': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=QQYdcFd9nJF9kFv+V6Lzpwp880Gr2U/yqbZ7w3/okQ4=; b=VP9bhaA1SgMwlQnT+r4aMwvsmrbKnJ/JYI+7qruZ0rU67hkp/e5mV3fvV2UDxCh3i0 HkCEcLdOaOo7A1Uc5YjE9Pm/kbZUOPVpdRhsV4kXMFnisXXpVvzTcSWCE5fAXhjnhD6G 4rbe5EzPqU/wKeicDXYruAXNEhrbGg7d5ZOwM= MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Mon, 12 Sep 2011 10:58:05 -0600 Subject: Re: Idioms combining 'next(items)' and 'for item in items:' To: Terry Reedy Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: 6 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1315847141 news.xs4all.nl 2401 [2001:888:2000:d::a6]:58389 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:13190 On Mon, Sep 12, 2011 at 10:55 AM, Ian Kelly wrote: > But you can't write the function under the assumption that it will > only be called from the function body. =A0The following is a slight > reorganization of your example that does exhibit the problem: s/function body/for-loop body/