How to retrieve original @classmethod, @staticmethod or @property
<p>I understand that @decorator.decorator doesn't allow to decorate above @staticmethod, @classmethod (and perhaps also @property). I understand the usage:</p>

<pre><code>class A(object):
    @classmethod
    @mydecorator
    def my_method(cls): pass
</code></pre>

<p>But, in a debugging module, I still want to try to do it dynamically. So I was wondering what is the way to retrieve the original method from those descriptor(?). I've read few responses, but I'm still confused...</p>

<p>I see some example with a class, and retrieving:</p>

<pre><code>class my_class(property):
    def __get__(self, obj, cls):
        return self.fget.__get__(None, cls)
</code></pre>

<p>I love the signature-preserving of decorator, but still not sure how to do this. The logic I try to implement is:</p>

<pre><code>import decorator

def mydecorator(f, *d_args, **d_kwargs):
    if (isinstance(f, classmethod)):
        return classmethod(mydecorator(f.__get__.?WHATELSE?))
    elif (isinstance(f, staticmethod)):
        return staticmethod(mydecorator(f.__get__.?WHATELSE?))
    elif (isinstance(f, property)):
        return property(mydecorator(f.__get__.?WHATELSE?))
    else:
        return decorator.decorator(f)
</code></pre>

<p>I'm trying to do this in Python 2.6, so I also welcome pointing that @decorator is changed (corrected?) in future version of python.</p>

<p>Thanks.</p>
