I have a Python class (I cut some code to simplify):
class c_DOT:
color = 0
class c_TAIL:
dot = c_DOT()
tails = []
def __init__(self) -> None:
for i in range(10):
self.tails.append(self.dot)
self.tails[i].color = i
print(self.tails[i].color)
# here I see array with different values 0..9 - everything is okay.
def test(self):
for i in range(0, 10):
print(self.tails[i].color)
# here a I see only 9,9,..9
then:
t = c_TAIL()
t.test()
As a result of the code above I got these lines:
0
1
2
3
4
5
6
7
8
9
9
9
9
9
9
9
9
9
9
9
but why only 9,9,9??
Thanks.

