I have a program (simplified version below) which creates objects in a loop. within that object there is a variable which should be set when the object is created. however, it seams to be storing the values of the previously created objects... for example/
class createList()
list1 = []
def __init__(self, int):
list1.append(int)
for i in range (0, 3)
x = createList(i)
print(x.list1)
>>> 0
>>> 0, 1
>>> 0, 1, 2
>>> 0, 1, 2, 3
Can anyone point me in the direction of what I'm, doing wrong?