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:
Chaozhe.Chen 2015-12-22 16:23:21 +08:00
parent 64beaaa820
commit 15a11128ac
1 changed files with 1 additions and 1 deletions

View File

@ -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)