How to check what is holding reference to object

Christian Heimes lists at cheimes.de
Wed Apr 28 08:59:42 EDT 2010


Almar Klein wrote:
> Ah, it does exist! I wish I knew that two months ago, it would've saved me
> some precious time ;)

The trick works only for objects that are tracked by CPython's garbage 
collector. Simple and non-containerish objects like str, int, unicode 
and some other types aren't tracked by the gc. IIRC all types written in 
Python are gc-aware.

Christian




More information about the Python-list mailing list