资料查看

1用 python实现个 异步的 http服务(太难)

class cached_property(object):
""" A property that is only computed once per instance and then replaces
itself with an ordinary attribute. Deleting the attribute resets the
property. """

def init(self, func):
update_wrapper(self, func)
self.func = func

def get(self, obj, cls):
if obj is None: return self
value = obj.dict[self.func.name] = self.func(obj)
return value

给celery贡献代码

posted @ 2016-09-26 14:35  easymoneySniper  阅读(175)  评论(0)    收藏  举报