title: How to test if a decorator is decorating a method or a function?
body: <p>I am just wondering for a decorator how can it know if a the function it is decorating is a method, a function, a static method, or a class method? What is the most robust way to distinguish these four different types inside a decorator?</p>