title: Refcount python objects
body: <p>I am trying to understand how the refcounts work in python, Can someone explain why the count gets printed as 2 when its just 1 instance for the object? (is it because of the temporary being passed to the getrefcount method?) Also why is the number more when invoked when invoked from the member (is self reference bumping the refcount?)</p>
  
  <pre><code>import sys
  
  class A:
      def print_ref_count(self):
          print sys.getrefcount(self)
  
  a = A()
  print sys.getrefcount(a)   # prints 2
  a.print_ref_count()        # prints 4
  print sys.getrefcount(a)   # prints 2
  </code></pre>