2
是否可以訪問綁定方法綁定的對象?如何從綁定方法獲取對實例的引用?
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 <2.6,'__self__'中使用'im_self'。 – wim