Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!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.028 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'received:209.85.212.46': 0.03; 'received:mail-vw0-f46.google.com': 0.03; 'to:name:python list': 0.09; ';-)': 0.14; 'expr': 0.16; 'pythonic': 0.16; 'return.': 0.16; 'otherwise,': 0.20; 'header:In-Reply-To:1': 0.22; 'received:209.85.212': 0.25; 'subject: -- ': 0.25; 'message- id:@mail.gmail.com': 0.28; "doesn't": 0.28; 'hey': 0.29; 'argue': 0.31; 'second': 0.31; "skip:' 10": 0.32; 'to:addr:python-list': 0.32; '...': 0.32; "isn't": 0.34; 'there': 0.35; 'point': 0.35; 'think': 0.36; 'none': 0.36; 'else': 0.37; 'received:209.85': 0.37; 'proposed': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'how': 0.39; 'header:Received:5': 0.40; 'further': 0.62; 'said:': 0.68; 'death!': 0.84; 'presumably': 0.91 MIME-Version: 1.0 Sender: z@etiol.net X-Originating-IP: [200.107.247.94] In-Reply-To: References: <8abff237-5ccd-4eb6-85c8-cdc9e87520b7@bl1g2000vbb.googlegroups.com> Date: Mon, 11 Apr 2011 22:43:44 -0400 X-Google-Sender-Auth: JiTKqSJR1suqR8iTcwmalqRUzAA Subject: Re: Feature suggestion -- return if true From: Zero Piraeus To: python list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 30 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302576228 news.xs4all.nl 81476 [::ffff:82.94.164.166]:57751 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3016 : >> This is only true if n < 5.=C2=A0 Otherwise, the first returns None and = the >> second returns False. > > Which is why I said: > > return expr or None > > But hey let's argue the point to death! Ok ;-) I think the point is that OP doesn't want to return *at all* if expr is False - presumably because there are further statements after the proposed 'conditional' return. Anyway, return? expr isn't very pythonic - so how about one of these? return expr if True return expr else continue I kid, I kid ... -[]z.