def methclass(meth): cls = meth.im_class name = meth.im_func.__name__ meth = getattr(cls,name,None) for cls in cls.mro(): _meth = getattr(cls,name,None) if _meth is not None and _meth==meth: result = cls return result
>>> methclass(b.foo) <class '__main__.A'> (Turns out equality bypasses the methodwraper trickery.) Simon. -- http://mail.python.org/mailman/listinfo/python-list