On 25 February 2010 09:21, Shashwat Anand <anand.shash...@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
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to