mdickinson/refcycle — pull request #1 by rkern (2013-07-18 16:38:18+00:00)
Title: ENH: Allow one to get a specified number of generations of ancestors or descendants.

It's ugly code, but it helped me recently trying to answer "Who is holding onto this object?" interactively. When everything should have been cleaned up but certain objects of interest were still in `gc.get_objects()`, I would drop into an embedded IPython shell with the graph loaded up. I could then slowly increase the number of generations back from my errant objects until I understood where they were ultimately coming from.