Use cached_property instead of a custom decorator

This commit is contained in:
James Westman 2022-03-16 16:06:00 -05:00
parent 1c1a5e3266
commit f197e68589
4 changed files with 15 additions and 28 deletions

View file

@ -32,18 +32,6 @@ class Colors:
CLEAR = '\033[0m'
def lazy_prop(func):
key = "_lazy_prop_" + func.__name__
@property
def real_func(self):
if key not in self.__dict__:
self.__dict__[key] = func(self)
return self.__dict__[key]
return real_func
def did_you_mean(word: str, options: T.List[str]) -> T.Optional[str]:
if len(options) == 0:
return None