We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebc2a27 commit d629e76Copy full SHA for d629e76
larray/util/misc.py
@@ -665,16 +665,17 @@ class lazy_attribute(object):
665
"""
666
def __init__(self, func):
667
self.func = func
668
- self.__doc__ = self.func.__doc__
+ self.__doc__ = func.__doc__
669
670
# descriptor protocol
671
# see https://docs.python.org/3/reference/datamodel.html#implementing-descriptors
672
def __get__(self, instance, owner):
673
if instance is None:
674
return self
675
676
- value = self.func(instance)
677
- setattr(instance, self.func.__name__, value)
+ func = self.func
+ value = func(instance)
678
+ setattr(instance, func.__name__, value)
679
return value
680
681
0 commit comments