title: How to pass function as an argument to another function, without running it automatically
body: <p>I have 2 functions - one that is checking object status and the second one that is creating some connections when allowed. I'm trying to pass a function as an argument, but return that only when conditions will be correct. The issue is it is running anyway.</p>
  <pre><code>testList = []
  
  def testObject(name, funct):
    if name == &quot;testName&quot;:
      b = funct
      return name + str(b)
    else:
      return None
  
  def someFunction(vector, opt, axis):
      testList.append(&quot;Something&quot;)
      return opt * axis
    
  a = testObject(&quot;testName2&quot;, someFunction([0,0,0], 1, 6) )
  
  print a
  print testList
  </code></pre>
  <p>Output:</p>
  <pre><code>print a
  print testList
  None
  ['Something']
  </code></pre>
  <p>So even if &quot;A&quot; is current, testList should be empty.
  Wonder what I'm doing wrong.</p>