def _unjelly_method(self, rest):
''' (internal) unjelly a method
'''
im_name = rest[0]
im_self = self.unjelly(rest[1])
im_class = self.unjelly(rest[2])
if type(im_class) is not types.ClassType:
raise InsecureJelly("Method found with non-class class.")
if im_class.__dict__.has_key(im_name):
if im_self is None:
im = getattr(im_class, im_name)
elif isinstance(im_self, NotKnown):
im = _InstanceMethod(im_name, im_self, im_class)
else:
im = instancemethod(im_class.__dict__[im_name],
im_self,
im_class)
else:
raise 'instance method changed'
return im
评论列表
文章目录