Reference counting

Terry Reedy tjreedy at
Thu Aug 29 19:50:46 CEST 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)

I presume you can also access via C API.

Terry J. Reedy

More information about the Python-list mailing list