Checking what function was passed into a function
<p>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 <code>sorted</code> 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:</p>

<pre><code>def mainFunction (x, y, helperFunction):
    if helperFunction == compareValues1():
         do stuff
    elif helperFunction == compareValues2():
         do other stuff
</code></pre>

<p>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? </p>
