Decorator changing function status from method to function
问题 [Updated]: Answer inline below question I have an inspecting program and one objective is for logic in a decorator to know whether the function it is decorating is a class method or regular function. This is failing in a strange way. Below is code run in Python 2.6: def decorate(f): print 'decorator thinks function is', f return f class Test(object): @decorate def test_call(self): pass if __name__ == '__main__': Test().test_call() print 'main thinks function is', Test().test_call Then on