I created a dictionary of objects. I'm trying to update the class variable (numbers) by removing an element from it. The problem is that it updates every class variable of the remaining objects. If I update the variable with a single integer it does fine. Does anyone have an idea why it happens and how could I fix it?
class Matrix():
numbers = set(range(1,10))
def __init__(self):
pass
def gen():
entries = set(range(1,10))
integer = random.randint(1,9)
dict = {}
for i in range(0,10):
dict['A{0}'.format(i)] = Matrix()
dict['A0'].numbers.remove(integer)
gen()