I have a function that takes a function as one of its arguments, but depending on the context that function could be one of several (they are all comparator functions for creating rules for the sorted
method). Is there any way to check which function was passed into a function? What I'm thinking is some kind of conditional logic like this:
def mainFunction (x, y, helperFunction):
if helperFunction == compareValues1():
do stuff
elif helperFunction == compareValues2():
do other stuff
etc. Would this work? Would I need to pass in all of the arguments for the function when checking for its existence? is there a better way?