A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-December/094440.html below:

[Python-Dev] recursive closures - reference leak

[Python-Dev] recursive closures - reference leak [Python-Dev] recursive closures - reference leakHrvoje Niksic hrvoje.niksic at avl.com
Tue Dec 8 14:52:06 CET 2009
Kristján Valur Jónsson wrote:
> The problem with this is that once you have called factorial() once, you 
> end up with a recursive cycle.  „factorial“ has become a cell object, 
> referencing the „helper“ function, which again refers to the outer cell 
> object.  This requires „gc“ to clean up.  Also, it is entirely 
> non-obvious.  the problem becomes worse if the inner function also 
> refers to some large, temporary variable, since it will get caught up in 
> the reference loop.

What problem are you referring to?  Python has a gc exactly to deal with 
situations like this one.  Surely you are aware that the cycle collector 
is invoked automatically without requiring user intervention.  What 
specific issue are you trying to work around?
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4