Encountering some bugs with lists in classes
I'm encountering some bugs with lists inside classes, with a list in one instance of a class changing when a list in another instance of the class is changed. Here's an example from the console:
>parents[1].conGenotype
[[object],[object],[object],[object],[object],[object],[object],[object],[object],[object],[object],[object],[object],[object],[object],[object]]
>players[1].conGenotype[0]=1
1
>parents[1].conGenotype
[1,[object],[object],[object],[object],[object],[object],[object],[object],[object],[object],[object],[object],[object],[object],[object]]
>parents[1]==players[1]
0
players[] is a list of player classes and so is parents[]. Each player class has a list conGenotype[]. When I modify conGenotype in players[1] the list also gets modified in parents[1]. They aren't the same instance, and no code is running to change either of the values (the project was paused while I was using the console), although players[1].conGenotype is set to parents[1].conGenotype at an earlier point (I think this is somehow causing the issue). Changing players[1].conGenotype does not change parents[2].conGenotype or any other values in parents[].
Also, I've found out that making a function return during a for loop causes weird outputs, even if the loop is broken after returning.
I'll be greatful for any help / suggestions on how to solve the issue or work around it. Thanks in advance!