Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.03; 'say,': 0.05; 'false.': 0.07; 'python': 0.09; 'arguments,': 0.09; 'indeed,': 0.09; 'loop.': 0.09; 'preferable': 0.09; 'received :mail-qc0-f174.google.com': 0.09; 'subject:while': 0.09; 'cc:addr :python-list': 0.10; 'iterated': 0.16; 'oct': 0.16; 'subject:expression': 0.16; 'suggesting': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.17; 'helper': 0.17; 'changes': 0.20; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; "d'aprano": 0.29; 'steven': 0.29; 'fri,': 0.30; 'could': 0.32; 'function.': 0.33; 'point.': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'should': 0.36; 'being': 0.37; 'rather': 0.37; 'received:209': 0.37; 'received:209.85.216': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'to,': 0.65; '26,': 0.65; 'satisfied': 0.83; 'all!': 0.84; 'from.': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=mMA+9zvDDOsoZp4ySo/oLh7Vpk1fPJIeYGp60JFMm9U=; b=ZnoLECueBrkHdIEkXPdUixGdIR69MhJHsYtEBdF85L4RIb2aQOHw1L6VpMU1LAisWy +JNyOeuyAFqLmvQAkdfIzQ5lLrZS/wPcZdomn9EEP5IiK10cIQc0dlafXGpxk+IPcGdy 8dteOHSBbbTlVuLpnd6NfwoheEhiW3Or5J3EMs2Qm7G/xT7Y/pjqfF+TgJJE7LGll6S8 MGy08tP/DJx+mhYAN0N3aziqgKU1JLXcKDKzS0LTeUEBouGYxo7D6+7yo5sZn0v/slDz cBC5W94Tuvu8R/haniid8NYXRSWKTJB//emRgfMDhzUa+owsAQSx84bcAKpZLROBNE+L cWNg== MIME-Version: 1.0 In-Reply-To: <508b2858$0$29967$c3e8da3$5496439d@news.astraweb.com> References: <50886398.5050301@tim.thechases.com> <7x7gqf1na2.fsf@ruckus.brouhaha.com> <508b2858$0$29967$c3e8da3$5496439d@news.astraweb.com> From: Devin Jeanpierre Date: Fri, 26 Oct 2012 20:27:32 -0400 Subject: Re: while expression feature proposal To: "Steven D'Aprano" Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351297695 news.xs4all.nl 6937 [2001:888:2000:d::a6]:53716 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32257 On Fri, Oct 26, 2012 at 8:18 PM, Steven D'Aprano wrote: >> I would like a better iter(), rather than a better while loop. It is >> irritating to pass in functions that take arguments, and it is >> impossible to, say, pass in functions that should stop being iterated >> over when they return _either_ a None or a, say, False. > > Write a trivial helper function. Not everything has to be a one-liner or > a built-in. You are missing the point. I was suggesting that the use case of new syntax might be satisfied instead by new functions, which are clearly preferable to new syntax from the perspective your rebuttal comes from. Indeed, one could write those helper functions, and use them, without any changes to Python being made at all! -- Devin