aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/func/__init__.py
diff options
context:
space:
mode:
authorworkfork <workfork@yandex-team.ru>2022-02-10 16:46:43 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:43 +0300
commitc3745173272d1cf5b0642debb40d019e7ae71094 (patch)
treedaee509c9d920ccdc727dbf1254b2183bf5f64aa /library/python/func/__init__.py
parent656921707c02b816d730f31c1fdc1d615adbfe00 (diff)
downloadydb-c3745173272d1cf5b0642debb40d019e7ae71094.tar.gz
Restoring authorship annotation for <workfork@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/python/func/__init__.py')
-rw-r--r--library/python/func/__init__.py40
1 files changed, 20 insertions, 20 deletions
diff --git a/library/python/func/__init__.py b/library/python/func/__init__.py
index 7424361635..82de2e60ea 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