Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'wed,': 0.04; 'executed': 0.09; 'received:209.85.160.174': 0.09; 'received:mail- gy0-f174.google.com': 0.09; 'to:name:python list': 0.09; 'this:': 0.11; 'def': 0.13; 'am,': 0.14; 'wrote:': 0.14; 'expr': 0.16; 'func():': 0.16; 'furman': 0.16; 'return.': 0.16; '\xc2\xa0if': 0.16; 'obviously': 0.20; 'code': 0.22; 'header:In-Reply-To:1': 0.22; 'keeps': 0.24; 'subject: -- ': 0.25; "i'm": 0.26; 'function': 0.27; 'message-id:@mail.gmail.com': 0.28; 'received:209.85.160': 0.28; 'thanks': 0.29; 'probably': 0.30; 'along.': 0.31; 'comments.': 0.31; 'solved': 0.31; 'however,': 0.31; 'to:addr:python-list': 0.32; 'thank': 0.32; 'lines': 0.34; 'post': 0.34; 'actually': 0.34; 'there': 0.35; 'question': 0.35; 'point': 0.35; 'getting': 0.36; 'think': 0.36; 'none': 0.36; 'two': 0.37; 'received:209.85': 0.37; 'apr': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'to:addr:python.org': 0.39; 'where': 0.39; 'received:209': 0.39; 'except': 0.39; 'would': 0.40; 'header:Received:5': 0.40; '13,': 0.60; 'back': 0.61; '2011': 0.62; 'making': 0.62; 'said:': 0.68 MIME-Version: 1.0 In-Reply-To: <4DA4DB0F.8040509@stoneleaf.us> References: <8abff237-5ccd-4eb6-85c8-cdc9e87520b7@bl1g2000vbb.googlegroups.com> <87k4eze4dl.fsf@mithlond.arda> <4DA4DB0F.8040509@stoneleaf.us> From: James Mills Date: Wed, 13 Apr 2011 09:12:19 +1000 Subject: Re: Feature suggestion -- return if true 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: 40 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302649963 news.xs4all.nl 81482 [::ffff:82.94.164.166]:60103 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3099 On Wed, Apr 13, 2011 at 9:06 AM, Ethan Furman wrote: > I think I see your point -- the OP said: > --> =C2=A0 =C2=A0_temp =3D expr > --> =C2=A0 =C2=A0if _temp: return _temp > > which is where you're getting > --> =C2=A0 =C2=A0return _temp or None > > However, most everyone ('cept you, it seems! ;) understood that there wou= ld > be more lines of code such that if bool(expr) =3D=3D False no return is e= xecuted > and the function keeps going merrily along. =C2=A0Like this: > --> def func(): > --> =C2=A0 =C2=A0 var1 =3D something() > --> =C2=A0 =C2=A0 var2 =3D something_else('this') > --> =C2=A0 =C2=A0 return? var1.hobgle(var2) > --> =C2=A0 =C2=A0 var3 =3D last_resort(var1) > --> =C2=A0 =C2=A0 return var3.wiglat(var2) > > > Looking back at the whole post now, I see nothing there to concretely mak= e > that point except the question mark on the return. Ethan I actually really appreciate your comments. Thank you! Yes I do understand there is probably more code that follows the return? - but I made an assumption and I'm not going back on it :) Thanks for making the two sides obviously clear! cheers James --=20 -- James Mills -- -- "Problems are solved by method"