Re: [Python-Dev] recursive closure

2014-09-10 Thread Chris Angelico
On Thu, Sep 11, 2014 at 12:55 PM, Li Tianqing wrote: > Hello, > Can someone explain me why gc(CPython) can not collect recursive > closure's cycle reference? There is no __del__ here, why gc can not > collect? Can you start by explaining what's not getting collected and what is? Where's the

[Python-Dev] recursive closure

2014-09-10 Thread Li Tianqing
Hello, Can someone explain me why gc(CPython) can not collect recursive closure's cycle reference? There is no __del__ here, why gc can not collect? Thanks a lot. For example: #!/usr/bin/env python import ipdb import gc gc.set_debug(gc.DEBUG_LEAK) def A(): N = [1] def aa(n): if n