如何获取在Python中定义方法的类?
我想要以下示例打印“ __main__.FooClass”:
class FooClass:
def foo_method(self):
print "foo"
class BarClass(FooClass):
pass
bar = BarClass()
print get_class_that_defined_method(bar.foo_method)
相关分类