mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Use cached_property instead of a custom decorator
This commit is contained in:
parent
1c1a5e3266
commit
f197e68589
4 changed files with 15 additions and 28 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue