Newbie Question regarding __init__()

Dave Angel davea at ieee.org
Tue Aug 4 15:29:35 CEST 2009


Dennis Lee Bieber wrote:
> On Mon, 03 Aug 2009 23:00:13 -0400, Dave Angel <davea at ieee.org>
> declaimed the following in gmane.comp.python.general:
>
>   
>> To throw away the result of an expression in Python is even easier.  
>> Just don't use it.
>>        func1() and func2()
>> is a valid expression whose result is not used.  And func2()'s result is 
>> therefore irrelevant.  But shortcircuiting means that func2() is only 
>> called if func1() returned False (or something equivalent to it, like 0 
>> or an empty list)
>>     
>
> 	Backwards...
>
> 	When using "and", the RHS is only evaluated if the LHS evaluates to
> TRUE (if the LHS is FALSE, why go further, since False and anything ->
> False). 
>
> Conversely, when using "or", the RHS is only evaluated if the LHS is
> FALSE.
>   
You're right of course.  Slip of the keyboard.

DaveA



More information about the Python-list mailing list