I have encountered a weird problem with following Python (2.7.3) script. Sometimes when e.g. a = True and b = False the subsequent if-clause evaluates to False and the code inside it will not be run.
It always works the first time when either a, b or both are True but sometimes later it randombly fails.
Can anyone explain this behaviour and how to avoid it? Thank you.
while True:
a = b = False
a = func1() # Returns True or False
b = func2() # Returns True or False
print a # Just for debugging..
print b # Just for debugging..
if(a or b):
print "Here we are.."
func3() # It may take hours until we return from here
time.sleep(45)