This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import MutableMapping | |
from functools import wraps | |
def lazy_load(f): | |
@property | |
@wraps(f) | |
def wrapped_fetch(self): | |
if f.func_name not in self._d: | |
self._d[f.func_name] = f(self) |
NewerOlder