How to check what is holding reference to object

Marius Gedminas mgedmin at gmail.com
Wed May 5 15:46:25 EDT 2010


On Apr 28, 3:59 pm, Christian Heimes <li... at cheimes.de> wrote:
> 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.

Yes they are -- have you ever tried

  >>> import gc
  >>> gc.get_referrers(42)

?


Marius Gedminas



More information about the Python-list mailing list