Deep copy vs Shallow Copy

Possible Duplicate:What is the difference between a deep copy and a shallow copy? What is the difference between deep and shallow copy. What type of a copy does a copy constructor do?

List changes unexpectedly after assignment. Why is this and how can I prevent it?

With new_list = my_list, you don’t actually have two lists. The assignment just copies the reference to the list, not the actual list, so both new_list and my_list refer to the same list after the assignment. To actually copy the list, you have various possibilities: You can use the builtin list.copy() method (available since Python 3.3):new_list = old_list.copy() You can slice it:new_list … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)