Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!news.ecp.fr!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.84.MISMATCH!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'wed,': 0.04; 'python?': 0.07; 'python': 0.07; '*is*': 0.09; 'counting': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'generators': 0.09; 'message- id:@stoneleaf.us': 0.09; 'received:gator410.hostgator.com': 0.09; '~ethan~': 0.09; 'wrote:': 0.14; 'generators.': 0.16; 'looping': 0.16; 'no;': 0.16; 'received:72.11': 0.16; 'received:72.11.125': 0.16; 'received:72.11.125.166': 0.16; 'what?': 0.16; 'argument': 0.16; 'suggest': 0.19; 'subject:list': 0.22; 'header:In-Reply- To:1': 0.22; 'loop': 0.22; 'trying': 0.23; 'instead': 0.26; 'knowing': 0.29; 'certainly': 0.29; 'all.': 0.30; 'construct': 0.31; 'does': 0.31; 'to:addr:python-list': 0.32; 'page': 0.33; 'using': 0.34; 'requires': 0.35; 'difficult': 0.35; 'header:User- Agent:1': 0.35; 'point': 0.35; 'widely': 0.35; 'feature': 0.36; 'should': 0.37; 'but': 0.38; 'common': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'job.': 0.60; '2011': 0.62; 'received:hostgator.com': 0.64; 'received:websitewelcome.com': 0.71; "'if": 0.84 Date: Wed, 11 May 2011 12:17:33 -0700 From: Ethan Furman User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: python-list@python.org Subject: Re: checking if a list is empty References: <9hYwp.5805$xo2.3333@newsfe07.iad> <4dc4b351$0$29991$c3e8da3$5496439d@news.astraweb.com> <4dca90c1$0$29980$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator410.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-Source: X-Source-Args: X-Source-Dir: 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: 24 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305140738 news.xs4all.nl 41114 [::ffff:82.94.164.166]:39751 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5152 Hans Georg Schaathun wrote: > On Wed, 11 May 2011 13:50:54 -0400, Prasad, Ramit > wrote: > : I find this argument to be flawed. Should I stop using built-in > : generators instead of range/xrange for looping through lists? > : Certainly for loops with loop counting are understood more widely > : than generators. Should I stop using any advanced feature Python > : because it is difficult to understand without knowing Python? > > No; I'd suggest the most legible and intuitive construct that /does/ the > job. Never something which requires one extra (illegible) page to do > the job, or something which does not do the job at all. > > : I may not have made the point well, but I cannot see any advantage > : for trying to program for the lowest common denominator. > > Common to what? I'd try the lowest common denominator of > legibility and effictiveness. > > It is just KISS. 'if li' *is* KISS. ~Ethan~