completely delete a list in python
<p>I'm using python 2, and trying to <strong>delete two lists</strong>.
Here is the code:</p>

<pre><code>test_data1 = [img for img in glob.glob("/location/of/images/*png")]
test_data0 = [img for img in glob.glob("/location/of/other_images/*png")]
test_data = test_data1 + test_data0
</code></pre>

<p>Every list of images contains millions of file-names, so I would prefer to delete the unnecessary lists after I created the <code>test_data</code> list. Just for make the code "easier" for the computer to run.</p>

<p>How can I do it?</p>

<p>I found few different ways, but no any of them refereed to memory issues. I'm not sure if  <code>test_data1=[]</code> actually delete the list completely from the memory.</p>

<p>also I'm afraid that the <code>test_data = test_data1 + test_data0</code> line only combine the hashes of the lists, and when I'll delete the two lists, <code>test_data</code> also become empty.</p>

<p>So.. what is the right way?</p>

<p>Really appreciate your help!
Sorry if the English is bad, I'm not a native speaker :P</p>

<p>Thanks! </p>