【发布时间】:2014-09-04 14:27:36
【问题描述】:
是否可以访问绑定方法绑定的对象?
class NorwegianBlue(object):
def hello(self):
print "Well, he's...he's, ah...probably pining for the fjords"
def some_method(self):
pass
thing = NorwegianBlue().some_method
the_instance = ???
thing.im_class.hello(the_instance)
【问题讨论】:
-
对于未来的读者:在 python im_self,否则使用
__self__。