Python 2.7.10
I wrote the following code to test a simple callback function.
def callback(a, b): print(\'Sum = {0}\'.format(a+b)) def main(
Your code is executed as follows:
main(callback(1, 2))
callback function is called with (1, 2) and it returns None (Without return statement, your function prints Sum = 3 and returns None)
callback
(1, 2)
None
Sum = 3
main function is called with None as argument (So callback != None will always be False)
main
callback != None
False