Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!bl1g2000vbb.googlegroups.com!not-for-mail From: zildjohn01 Newsgroups: comp.lang.python Subject: Feature suggestion -- return if true Date: Mon, 11 Apr 2011 16:17:25 -0700 (PDT) Organization: http://groups.google.com Lines: 14 Message-ID: <8abff237-5ccd-4eb6-85c8-cdc9e87520b7@bl1g2000vbb.googlegroups.com> NNTP-Posting-Host: 99.97.82.224 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1302563845 24555 127.0.0.1 (11 Apr 2011 23:17:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 11 Apr 2011 23:17:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: bl1g2000vbb.googlegroups.com; posting-host=99.97.82.224; posting-account=h1nSJQoAAAAH98bV3jW53K9e8sIGhpxU User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; U; bigjohnexpress; en; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 Opera 11.00,gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3003 This is an idea I've had bouncing around in my head for a long time now. I propose the following syntax: return? expr be expanded to _temp = expr if _temp: return _temp It's a pattern I use all the time in my code, and although it's a bit unorthodox, IMO it's concise, readable, and easily understandable. Thoughts?