[BangPypers] date range

Vinay Shastry vinayshastry at gmail.com
Thu Feb 25 04:58:07 CET 2010


On 25 February 2010 09:21, Shashwat Anand <anand.shashwat at gmail.com> wrote:
>>
>> It can be called just once too...
>>
>> >>> def foo():
>> ...   print "called"
>> ...   return 0
>> ...
>> >>> 1 < foo() and foo() < 3
>> called
>> False
>>
>
> This is because AND operator short-circuits. So when 1 < foo() is false, it
> terminates then and there. Srinivas is correct here.
>

Yes, I'm just countering:
"It's called TWICE  , no matter with or without side effects."




-- 
Vinay S Shastry
http://thenub.one09.net


More information about the BangPypers mailing list