 <p><code>recs = unique_recs_in</code> simply creates a new reference to the list object, to get a completely new copy of a list of lists use <code>copy.deepcopy</code>.</p> <pre><code>&gt;&gt;&gt; lis = [[1, 2], [3, 4]] &gt;&gt;&gt; a = lis &gt;&gt;&gt; a.append(4) #changes both `a` and `lis` &gt;&gt;&gt; a, lis ([[1, 2], [3, 4], 4], [[1, 2], [3, 4], 4]) </code></pre> <p>Even a shallow copy is not enough for list of lists:</p> <pre><code>&gt;&gt;&gt; a = lis[:] &gt;&gt;&gt; a[0].append(100) #Inner lists are still same object, just the outer list has changed. &gt;&gt;&gt; a, lis ([[1, 2, 100], [3, 4]], [[1, 2, 100], [3, 4]]) </code></pre> <p><code>copy.deepcopy</code> returns a completely new copy:</p> <pre><code>&gt;&gt;&gt; import copy &gt;&gt;&gt; a = copy.deepcopy(lis) &gt;&gt;&gt; lis [[1, 2, 100], [3, 4], 4] &gt;&gt;&gt; a.append(999) &gt;&gt;&gt; a, lis ([[1, 2, 100], [3, 4], 4, 999], [[1, 2, 100], [3, 4], 4]) &gt;&gt;&gt; a[0].append(1000) &gt;&gt;&gt; a, lis ([[1, 2, 100, 1000], [3, 4], 4, 999], [[1, 2, 100], [3, 4], 4]) </code></pre> <p>If the list contains only immutable objects, then only a shallow copy is enough:</p> <pre><code>recs = unique_recs_in[:] </code></pre> <hr> <p>You might find this helpful as well: <a href="http://stackoverflow.com/a/17599215/846892">Python <code>list([])</code> and <code>[]</code></a></p>