In Python I need to efficiently and generically test whether an attribute of a class is an instance method. The inputs to the call would be the name of the attribute being check
def hasmethod(obj, name): return hasattr(obj, name) and type(getattr(obj, name)) == types.MethodType