Python capture method call and parameters
<p>I'm trying to capture a function call from a singleton class without override the method. </p>

<p>Currently I'm doing this:</p>

<pre><code>class MyClass
    oldMethod = None

    def __init__(self):
        c = Class.Instance()
        self.oldMethod = c.Method #make a copy to the pointer of the original function
        c.Method = self.NewMethod #redirect it

    def NewMethod(self, x, a):
        self.oldMethod(x, a) #call the old function
        #My Stuff
</code></pre>

<p>I'm trying to capture the 'event' (being the method call) and the parameters of this method call. Is there any other way to do this to says 'passively' capture it, just listen and get the parameters. </p>

<p>Note: I do not have access to the code of singleton class.</p>

<p>Thanks</p>
