def foo(a): print(\"I\'m foo\") return False if foo: print(\"OK\") else: print(\"KO\")
I run it and it returns OK. I know, I should h
In this case your code is same as
if foo != None: print("OK") else: print("KO")
Result is
"OK"
because foo actually exists.
foo