Detecting bound method in classes (not instances) in Python 3
问题 Given a class C with a function or method f , I use inspect.ismethod(obj.f) (where obj is an instance of C ) to find out if f is bound method or not. Is there a way to do the same directly at the class level (without creating an object)? inspect.ismethod does not work as this: class C(object): @staticmethod def st(x): pass def me(self): pass obj = C() results in this (in Python 3): >>> inspect.ismethod(C.st) False >>> inspect.ismethod(C.me) False >>> inspect.ismethod(obj.st) False >>> inspect