| Total Complexity | 3 |
| Total Lines | 10 |
| Duplicated Lines | 0 % |
| 1 | class cached_property(object): |
||
| 2 | def __init__(self, func): |
||
| 3 | self.func = func |
||
| 4 | self.__doc__ = func.__doc__ |
||
| 5 | |||
| 6 | def __get__(self, obj, cls): |
||
| 7 | if obj is None: |
||
| 8 | return self |
||
| 9 | value = obj.__dict__[self.func.__name__] = self.func(obj) |
||
| 10 | return value |
||
| 11 |