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?
The following example code shows that python will mistakingly think I am passing the member variable:
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()
I am using python 3.5