class Response(object):
def __init__(self):
self.status = True
self.detail = None
self.data = [11,22,33]
@property
def dict(self):
return self.__dict__
obj = Response()
print(obj.dict) # {'status': True, 'detail': None, 'data': [11, 22, 33]}
标签:__,封装,22,self,28,detail,dict,返回值
From: https://www.cnblogs.com/mimiICC/p/16755178.html