Here is an example
class A(object):
def f1(self):
return []
test1 = property(f1)
class B(A):
def f1(self):
return [1, 2]
if __name__ == "__main__":
b = B()
print b.test1
I expect the output to be [1, 2], but it prints [] instead.
It is contrary to my expectation.
Did I make any mistake in the code? If not, I suppose it works this way because when the property test1 is created, it is bound to the f1 function of the base class A. What is a possible alternative implementation to achieve what I want?