Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:while': 0.07; 'none:': 0.09; 'parsing': 0.09; '"none"': 0.16; 'bieber': 0.16; 'input,': 0.16; 'question.': 0.16; 'wrote:': 0.16; 'discussion': 0.22; 'header:In-Reply-To:1': 0.22; 'sep': 0.23; 'input': 0.24; 'preferred': 0.25; 'lee': 0.28; 'thu,': 0.28; 'exit': 0.29; 'print': 0.29; 'thanks': 0.30; 'there': 0.33; 'to:addr:python- list': 0.33; 'header:User-Agent:1': 0.34; 'focus': 0.34; 'things': 0.34; 'object': 0.35; 'received:76': 0.37; 'received:org': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'interest': 0.65; 'note:': 0.68; 'dennis': 0.77; 'excluded': 0.91 X-Virus-Scanned: by ClamAV at spartan.hamla.org Date: Fri, 02 Sep 2011 15:56:46 -0400 From: Sahil Tandon User-Agent: Postbox Express 1.0.1 (Macintosh/20100705) MIME-Version: 1.0 To: python-list@python.org Subject: Re: idiomatic analogue of Perl's: while (<>) { ... } References: <20110901045650.GA3466@magic.hamla.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1314993413 news.xs4all.nl 2461 [2001:888:2000:d::a6]:38339 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12668 Dennis Lee Bieber wrote: > On Thu, 1 Sep 2011 00:56:50 -0400, Sahil Tandon >> # process input, line-by-line, and print responses after parsing input >> while 1: >> rval = parse(raw_input()) >> if rval == None: > > There is only ONE "None" object so the preferred method is > > if rval is None: Understood; thanks for that enlightenment. > Note: I don't see any exit handler/condition... Indeed. I excluded such things in the interest of brevity, to focus the discussion on my question. :) -- Sahil Tandon