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 in N:
return 1
else:
return n * aa(n-1)
x = 33 + aa(10)
#ipdb.set_trace()
print x
if __name__ == '__main__':
while xrange(1000):
A()
--
Best
Li Tianqing
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com