Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!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.149 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.70; '*S*': 0.00; 'pm,': 0.11; 'wrote:': 0.14; 'expr': 0.16; 'piraeus': 0.16; 'pythonic': 0.16; 'tue,': 0.20; 'header:In-Reply-To:1': 0.22; 'subject: -- ': 0.25; "i'm": 0.26; 'chris': 0.27; 'message-id:@mail.gmail.com': 0.28; 'condition.': 0.29; 'if,': 0.31; 'to:addr:python-list': 0.32; '...': 0.32; 'idea': 0.32; "isn't": 0.34; 'actually': 0.34; 'think': 0.36; 'else': 0.37; 'received:209.85': 0.37; 'useful': 0.37; 'apr': 0.38; 'received:google.com': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'how': 0.39; "it's": 0.40; 'header:Received:5': 0.40; 'might': 0.40; '2011': 0.62; '12:43': 0.84; 'received:209.85.210.174': 0.84; 'received :mail-iy0-f174.google.com': 0.84; 'stupid': 0.84; 'or:': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=XNmXuziyk17bKrHqo3l7nr6X3AbhXn/MQaKTJ1uushM=; b=C18PPG5ZAA1zHSLxYscze3vhM48wykhFBQTPJPrSpb6mq9+xri95UWl7gJaGgh17C9 Bl9FDodsbrT15N3KTaLKMOQlxh7d760vh8QoTw/mFoohZxCpOq6awBkpoNWuhn30hS8+ zlfdj3D8wOUr0oLdT4Of2BX2lMDW5IHYPObVQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=De6zVMXqtuFhTTopUdoC/noVszKV0Y6fy5P4N9nKfgwW0g2ddlzHUyBotlVhHL6Zsb j04oQd0Rf/rvcaloK/WLvbyKoK4EGhzE8UdnfWQgRsQq2RO0AFUIMvG1YOU/8WzhSz/E zfk7ghS/JZh9JL/Z/xZ5DxiYtMfp8z0GazOOI= MIME-Version: 1.0 In-Reply-To: References: <8abff237-5ccd-4eb6-85c8-cdc9e87520b7@bl1g2000vbb.googlegroups.com> Date: Tue, 12 Apr 2011 12:49:28 +1000 Subject: Re: Feature suggestion -- return if true From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 20 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302576571 news.xs4all.nl 81475 [::ffff:82.94.164.166]:47160 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3019 On Tue, Apr 12, 2011 at 12:43 PM, Zero Piraeus wrote: > =A0return? expr > > isn't very pythonic - so how about one of these? > > =A0return expr if True > =A0return expr else continue > > I kid, I kid ... Or: if expr: return it Actually, I'm not sure how stupid an idea that is. Inside an if, 'it' is the value of the condition. Might actually be useful in a few places.... Naw, I think it's still a stupid idea. Chris Angelico