Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!tudelft.nl!txtfeed1.tudelft.nl!dedekind.zen.co.uk!zen.net.uk!hamilton.zen.co.uk!reader02.news.zen.co.uk.POSTED!not-for-mail From: Nobody Subject: Re: Feature suggestion -- return if true Date: Tue, 12 Apr 2011 07:08:37 +0100 User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.python References: <8abff237-5ccd-4eb6-85c8-cdc9e87520b7@bl1g2000vbb.googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lines: 25 Organization: Zen Internet NNTP-Posting-Host: cea81a46.news.zen.co.uk X-Trace: DXC=S;\7JM]nQ_FVJAUaCl]GdJYjZGX^207PK`> That's still not equivalent. "return expr or None" will always >> terminate the function. The OP's request was for something which would >> terminate the function if and only if expr is non-false. > > The OP did not state this at all. > There was never any mention of early termination > of the function iif expr was True. What the OP actually said was: > I propose the following syntax: > > return? expr > > be expanded to > > _temp = expr > if _temp: return _temp It should be abundantly clear that this only returns if the expression is considered true, otherwise it continues on to the following statements.