I have list of int's called board
in python code. I wan't to know, if it was modified, so I have code
self.oldboard = list(self.board)
#here is board modified, if it is possible
if not self.oldboard == self.board:
#this should execute only when board was modified
But oldboard
is always equals to board
, when I modify board
, it modifies oldboard
. How to make oldboard
just copy of board
, not reference?