Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!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.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'python': 0.08; 'declarations': 0.09; 'message- id:@glegroupsg2000goo.googlegroups.com': 0.09; 'reply- to:addr:comp.lang.python': 0.09; 'to:addr:comp.lang.python': 0.09; '"for"': 0.16; '"if"': 0.16; 'boolean': 0.16; 'subject:iterable': 0.16; 'cc:addr:python-list': 0.16; 'stick': 0.18; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'variable': 0.24; 'code': 0.25; "i'm": 0.27; 'anyway.': 0.29; 'html,': 0.29; 'cc:addr:python.org': 0.30; 'thanks': 0.30; 'subject:?': 0.31; 'header:User-Agent:1': 0.34; 'all.': 0.34; 'variables': 0.37; 'reasons': 0.37; 'using': 0.37; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'subject: (': 0.39; 'subject:are': 0.70; 'header:Reply- To:1': 0.71; 'reply-to:no real name:2**0': 0.71; 'reply- to:addr:googlegroups.com': 0.74; 'subject:you': 0.81; 'readability': 0.84; 'subject:Best': 0.93 Newsgroups: comp.lang.python Date: Wed, 7 Sep 2011 17:53:36 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.239.111.183; posting-account=v7uz7AoAAADrY3ej1N8wVPiFcnr81fn4 References: User-Agent: G2/1.0 X-Google-Web-Client: true MIME-Version: 1.0 Subject: Re: Best way to check that you are at the beginning (the end) of an iterable? From: Laurent To: comp.lang.python@googlegroups.com 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 Reply-To: comp.lang.python@googlegroups.com List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 4 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1315443220 news.xs4all.nl 2421 [2001:888:2000:d::a6]:57288 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12930 Yes of course the use of a boolean variable is obvious but I'm mixing pytho= n code with html using Mako templates. In Mako for code readability reasons= I try to stick to simple "for" and "if" constructions, and I try to avoid = variables declarations inside the html, that's all. Thanks anyway.