How do I change an element in a list, and keep a copy of the original list?
<p>I've searched around and tried a lot of stuff but I can't get this to work. I think the problem is something to do with how Python list names <em>point</em> to the list, rather than <em>being</em> the actual list, but I still can't figure it out. The situation is this (it's a list of dictionaries):</p>

<pre><code>list_original = [dictionary1, dictionary2, dictionary3]
dictionary2_modified = dictionarymodifier(dictionary2) #some function that modifies the chosen element
list_modified = [i for i in list_original] #makes copy of original list
for i,n in enumerate(dictionary_original):
    if i==1:
        list_modified[1] = dictionary2_modified #replaces element with modified version
return list_original, list_modified
</code></pre>

<p>And many similar things, but I always either get two of the original list or two of the new list! I add that I'm using python 2.4 and don't have a choice in that.</p>

<p>Many thanks for any help</p>
