class Descriptor():
def __get__(self, obj, obj_class):
if obj == None:
return "method2 called by instance object"
else:
return "method2 callled by class object"
class Bar():
m2 =
python 中的descriptor 详解
最新推荐文章于 2021-06-18 19:05:32 发布