mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
cleanup: Use functools.cached_property
This commit is contained in:
parent
3b22dff988
commit
a0e9f647d1
4 changed files with 14 additions and 27 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