##// END OF EJS Templates
small fix for lazy property
marcink -
r2494:c4d418b4 beta
parent child Browse files
Show More
@@ -17,11 +17,12 class LazyProperty(object):
17
17
18 def __init__(self, func):
18 def __init__(self, func):
19 self._func = func
19 self._func = func
20 self.__module__ = func.__module__
20 self.__name__ = func.__name__
21 self.__name__ = func.__name__
21 self.__doc__ = func.__doc__
22 self.__doc__ = func.__doc__
22
23
23 def __get__(self, obj, klass=None):
24 def __get__(self, obj, klass=None):
24 if obj is None:
25 if obj is None:
25 return None
26 return self
26 result = obj.__dict__[self.__name__] = self._func(obj)
27 result = obj.__dict__[self.__name__] = self._func(obj)
27 return result
28 return result
General Comments 0
You need to be logged in to leave comments. Login now