Feature suggestion -- return if true

James Mills prologic at shortcircuit.net.au
Tue Apr 12 19:12:19 EDT 2011


On Wed, Apr 13, 2011 at 9:06 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
> I think I see your point -- the OP said:
> -->    _temp = expr
> -->    if _temp: return _temp
>
> which is where you're getting
> -->    return _temp or None
>
> However, most everyone ('cept you, it seems! ;) understood that there would
> be more lines of code such that if bool(expr) == False no return is executed
> and the function keeps going merrily along.  Like this:
> --> def func():
> -->     var1 = something()
> -->     var2 = something_else('this')
> -->     return? var1.hobgle(var2)
> -->     var3 = last_resort(var1)
> -->     return var3.wiglat(var2)
>
>
> Looking back at the whole post now, I see nothing there to concretely make
> 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

-- 
-- James Mills
--
-- "Problems are solved by method"



More information about the Python-list mailing list