title: How to give object away to python garbage collection?
body: <p>There are several threads on Python garbage collection in SO, and after reading about five, plus some doc on line, i am still not sure as to how garbage collection works and how i should manage objects which i am not using. In fact somewhere i read one should not do anything about collecting garbage, others tell one should <code>del</code> objects, while others again explain de-referencing an object is enough for Python to collect it as garbage.</p>
  
  <p>So, at the risk of creating a duplicate, i will ask the question again, but differently, hoping to get more comprehensive and clearer information.</p>
  
  <p>In my case i want to make a small simulation with objects representing people. Several instances of the <code>Person()</code> class will be created. It should exist for some time until it virtually "dies" while other instances will be created.</p>
  
  <p>Now how do i make this <code>Person()</code> instance "die" (assuming many many of these instances will be created and i don't want these instances to hang out like ghosts)?</p>
  
  <p>There are several ways i can reference an object:</p>
  
  <pre><code>john = Person('john')
  </code></pre>
  
  <p>or</p>
  
  <pre><code>people = []
  people.append(Person('john'))
  </code></pre>
  
  <p>or</p>
  
  <pre><code>people = {}
  people['john'] = Person('john')
  </code></pre>
  
  <p>What is the best way to keep my program clean, freeing resources optimally? And what is the best way then to reference my object so i can control the deletion of the object?</p>