PyDocs

Nav

Python Runtime Services

getrefcount

sys

function
  • getrefcount(object)
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().

The official docs include a CPython implementation detail for this entry.

Changed in 3.12
  • 3.12: Immortal objects have very large refcounts that do not match the actual number of references to the object.
0 Examples
No examples for sys/getrefcount.
See Also
No see-alsos for sys/getrefcount
0 Notes
No notes for getrefcount