On Tue, Apr 12, 2011 at 12:20 PM, James Mills
<prolo...@shortcircuit.net.au> wrote:
> On Tue, Apr 12, 2011 at 12:18 PM, Jason Swails <jason.swa...@gmail.com> wrote:
>> This is only true if n < 5.  Otherwise, the first returns None and the
>> second returns False.
>
> Which is why I said:
>
> return expr or None
>
> But hey let's argue the point to death!

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.

Chris Angelico
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to