I looked it up and python seems to have the same “problem” than Java.
Have you ever tried copying an array with:
array1=array2
You should notice that they are “linked” so any action you do with one you also do to the other this is called a deep copy.
Types like numbers or string don’t have deep copies so you can savely use:
number1=number2
What python does it duplicates the line-array however it uses a deep copy so any action you perform on one is also performed on the other.
What you are looking for is a shallow copy wich only copies the data there is actually a library for this so you can use:
import copy
m=10
n=10
grid=n*[copy.copy(m*[1])]
I don’t know if python mode of Processing has a built in function for this.