title: Python: how do I explicitly pass a function inside a function
body: <p>So I know that it's possible to pass a function into a function. But I am using a certain library that has a member variable and a function with the same name. How do I tell python to pass the function inside of the function rather than the member variable?</p>
  
  <p>The following example code shows that python will mistakingly think I am passing the member variable:</p>
  
  <pre><code>class foo():
      def __init__(self):
          self.ambiguous = "member variable" # Member variable I don't want to be passed into another function
  
      def ambiguous(self): # Function I want to be passed into another function
          print("function")
  
  def testFunc(func): # This function is intended to be passed a function
      func()
  
  def main():
      myFoo = foo()
      testFunc(myFoo.ambiguous) # this will pass the member variable (I want to pass the function)
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>I am using python 3.5</p>