def __get__(self, instance, owner):
if inspect.ismethoddescriptor(self.value) or inspect.isdatadescriptor(self.value):
return self.value.__get__(instance, owner)
if inspect.isfunction(self.value):
if instance is None:
return self
else:
return six.create_bound_method(self.value, instance)
else:
return self.value
#------------------------------------------------[ CheckedInstance ]
评论列表
文章目录