John Nagle <[EMAIL PROTECTED]> wrote: > I'm printing out each entry in "gc.garbage" after a garbage collection in > DEBUG_LEAK mode, and I'm seeing many entries like > ><cell at 0x00F7C170: function object at 0x00FDD6B0> > > That's the output of "repr". Are "cell" objects created only from > external C libraries, or can regular Python code generate them? Is there > any way to find out what the 'function object' is from within Python? > Cell objects are created whenever you have a function that references a variable in an outer scope. e.g.
>>> def outer(): x = 42 def inner(): return x return inner >>> inner = outer() >>> inner.func_closure[0] <cell at 0x00C5D450: int object at 0x009657AC> >>> inner.func_closure[0].cell_contents 42 So in your case, cell.cell_contents.func_name might help. -- http://mail.python.org/mailman/listinfo/python-list