Reference counting

Terry Reedy tjreedy at udel.edu
Thu Aug 29 13:50:46 EDT 2002


. Is it possible to get the
> reference count of a Python object so I could check whether this is
really the
> case?

from python:
>>> import sys
>>> a = 3
>>> sys.getrefcount(a)
10

I presume you can also access via C API.

Terry J. Reedy






More information about the Python-list mailing list