This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
multipub/.pyenv/lib/python3.7/site-packages/lazy_object_proxy/utils.py

14 lines
291 B
Python
Raw Normal View History

2019-02-09 02:45:25 -06:00
def identity(obj):
return obj
class cached_property(object):
def __init__(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