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/094456.html below:

[Python-Dev] recursive closures - reference cycle

[Python-Dev] recursive closures - reference cycle [Python-Dev] recursive closures - reference cycleKristján Valur Jónsson kristjan at ccpgames.com
Wed Dec 9 13:03:52 CET 2009
> -----Original Message-----
> From: python-dev-bounces+kristjan=ccpgames.com at python.org
> [mailto:python-dev-bounces+kristjan=ccpgames.com at python.org] On Behalf
> Of Greg Ewing
> Sent: 8. desember 2009 22:09
> To: python-dev at python.org
> Subject: Re: [Python-Dev] recursive closures - reference cycle
> 
> You could use a class:

Yes, and a number of different workarounds.  That's not really the issue.  The issue is that what looks like a perfectly safe idiom (calling a function recursively) happens to create a reference cycle if that function is a closure.
This is a non-obvious "gotcha" that I must now educate my team about.

Note that at least parts of the library strive to avoid reference cycles even though "gc" exists.  An example being xlm.minidom.Document.unlink()

Cheers,

Kristján

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