From 89db6fe2fe2c32d2a832ddfeb04e8d078e301084 Mon Sep 17 00:00:00 2001 From: workfork Date: Thu, 10 Feb 2022 16:46:43 +0300 Subject: Restoring authorship annotation for . Commit 2 of 2. --- library/python/func/__init__.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'library/python/func') diff --git a/library/python/func/__init__.py b/library/python/func/__init__.py index 82de2e60ea2..74243616355 100644 --- a/library/python/func/__init__.py +++ b/library/python/func/__init__.py @@ -44,26 +44,26 @@ def lazy_property(fn): return _lazy_property -class classproperty(object): - def __init__(self, func): - self.func = func - - def __get__(self, _, owner): - return self.func(owner) - - -class lazy_classproperty(object): - def __init__(self, func): - self.func = func - - def __get__(self, _, owner): - attr_name = '_lazy_' + self.func.__name__ - - if not hasattr(owner, attr_name): - setattr(owner, attr_name, self.func(owner)) - return getattr(owner, attr_name) - - +class classproperty(object): + def __init__(self, func): + self.func = func + + def __get__(self, _, owner): + return self.func(owner) + + +class lazy_classproperty(object): + def __init__(self, func): + self.func = func + + def __get__(self, _, owner): + attr_name = '_lazy_' + self.func.__name__ + + if not hasattr(owner, attr_name): + setattr(owner, attr_name, self.func(owner)) + return getattr(owner, attr_name) + + def memoize(limit=0, thread_local=False): assert limit >= 0 -- cgit v1.3