I was trying to figure out how python store the reference count of an object :
getrefcount(...)
getrefcount(object) -> integer
Return the reference count of object. The count returned is generally
one higher than you might expect, because it includes the (temporary)
reference as an argument to getrefcount().
>>>
>>> s = 'string'
>>> sys.getrefcount(s)
28
>>> d = {'key' : s}
>>> sys.getrefcount(s)
29
>>> l = [s]
>>> sys.getrefcount(s)
30
>>> del l
>>> sys.getrefcount(s)
29
>>> del d
>>> sys.getrefcount(s)
28
>>>
In my above snippet, as soon as i create a string object s i got the ref-count 28, then when i assigned inside a dictionary its ref-count increment by one. And I don't know why it starts with 28.
So, Here I am trying to figure out where this values store or how python get it.
Thanks