Trivial: Remove meaningless default value in __get__()
In function object.__get__(self, instance, owner), owner is always the owner class, while instance is the instance that the attribute was accessed through, or None when the attribute is accessed through the owner. Setting owner default value makes no sense. refer to: http://python-reference.readthedocs.org/en/latest/docs/dunderdsc/get.html#get Change-Id: I5b84c77a52e5b26cb76d70ac738e1caef6e74c09 Closes-Bug: #1531395
This commit is contained in:
parent
64beaaa820
commit
15a11128ac
|
@ -132,7 +132,7 @@ class cached_property(object):
|
|||
self.__name__ = name or func.__name__
|
||||
self.__doc__ = doc or func.__doc__
|
||||
|
||||
def __get__(self, obj, type=None):
|
||||
def __get__(self, obj, owner):
|
||||
if obj is None:
|
||||
return self
|
||||
value = self.func(obj)
|
||||
|
|
Loading…
Reference in New Issue