Hi, Metehan.
Well, the same discussion is followed on this thread as well. It provides a proper understanding on why we use copy.deepcopy for w.
This link digs deeper into the subject of shallow and deep copy.