I'm creating members using the property function, but when I'm trying to override the setters and getters of those properties, it always reference the setters and getters of the parent class:
class A():
def evaluate(self):
return 'A'
value = property(evaluate)
class B(A):
def evaluate(self):
return 'B'
b = B()
print(b.value) # I get 'A'
I tried to put the definition of the value member inside the constructor of the parent such as:
self.value = property(self.evaluate)
but when accessing the value of an object it returns a property object not the actual value such as : 'A' or 'B.
<property object at 0x7fecd01a88b8>
I know how to workaround this issue, but I want to know if it is possible to solve it using the property function/decorator and without code repetition.