[Python-Dev] Garbage collecting closures

Neil Schemenauer nas@python.ca
Mon, 14 Apr 2003 15:09:14 -0700


Paul Prescod wrote:
> I'm no going to advocate a particular strategy because I don't know 
> enough of the performance and implementation costs. But you asked for a 
> strategy so I'll at least suggest one. Python could run gc.collect() 
> after returning from functions containing nested recursive functions. 

gc.collect() is too expensive for that to be feasible.

  Neil