How to make a copy of a list of objects not change when modifying the original list?

Viewed 41750

Possible Duplicates:
How to clone a list in python?
What is the best way to copy a list in Python?

original_list = [Object1(), Object2(), Object3()]
copy_list = original_list
original_list.pop()

If I remove an object from the original list, how can I keep the copy list from changing as well?

Original List

[<Object.Object instance at 0x00EA29E0>, <Object.Object instance at 0x00EA2DC8>, <Object.Object instance at 0x00EA2EE0>]

Copy List after popping the original list (I want this to equal what is above)

[<Object.Object instance at 0x00EA29E0>, <Object.Object instance at 0x00EA2DC8>]
3 Answers
Related