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


Groups > comp.lang.python > #13190

Re: Idioms combining 'next(items)' and 'for item in items:'

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 <ian.g.kelly@gmail.com>
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 <CALwzidnPj4rLpyk3NvogZshQd8y2rJnKrii47-5_N8FNBKf8Hg@mail.gmail.com>
References <j4gea4$m3b$1@dough.gmane.org> <CALwzidkeRA69p+Vw80xnE_sndx64zr2yXQsFZhS520KYbjxTxA@mail.gmail.com> <j4iomc$te4$1@dough.gmane.org> <CAPTjJmrXNjoccWAjwPO7yGHjQsruvJ7Kn6WWum6ywwWd+GZpoQ@mail.gmail.com> <j4jknm$cpd$1@dough.gmane.org> <CALwzidnPj4rLpyk3NvogZshQd8y2rJnKrii47-5_N8FNBKf8Hg@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Mon, 12 Sep 2011 10:58:05 -0600
Subject Re: Idioms combining 'next(items)' and 'for item in items:'
To Terry Reedy <tjreedy@udel.edu>
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 <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.1041.1315847141.27778.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Mon, Sep 12, 2011 at 10:55 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> But you can't write the function under the assumption that it will
> only be called from the function body.  The following is a slight
> reorganization of your example that does exhibit the problem:

s/function body/for-loop body/

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


Thread

Re: Idioms combining 'next(items)' and 'for item in items:' Ian Kelly <ian.g.kelly@gmail.com> - 2011-09-12 10:58 -0600

csiph-web