I want to set class property dynamicly. I do it like this:
class Foo:
def __init__(self):
self.a = 1
for v in [1, 2, 3]:
setattr(Foo, f"test_{v}", property(lambda self: self.a + v))
foo = Foo()
print(foo.test_1)
print(foo.test_2)
print(foo.test_3)
but I find that this will return the same result.