Reputation: 192
class A(object):
has_access = True
class B(A):
@property
def has_access(self):
if (condition):
return True
else:
return super(B, self).__getattribute__('has_access')
This does not work (goes in an endless loop). Is there any way to access the original value of the inherited object?
Upvotes: 0
Views: 99
Reputation: 2146
Try this:
class A(object):
has_access = True
class B(A):
@property
def has_access(self):
if (condition):
return True
else:
return super(B, self).has_access
Upvotes: 2