weakrefs and avoiding bad gc cycles

Aaron Bentley aaron at aaronbentley.com
Wed Jun 1 17:34:29 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11-05-31 11:48 PM, Martin Pool wrote:
> On 1 June 2011 13:32, Robert Collins <robertc at robertcollins.net> wrote:
>> So nothing will leave cycles around indefinitely with *one* exception - __del__.
> 
> Right, which we pretty much ban: all of them give a warning that you
> should have explicitly closed the object, except, strangely,
> SmartMedium (which may be a bug.)
> 
> Possible we should even get rid of them in non-debug mode.

Yes.  No matter how __del__ is defined, it forces the GC to treat such
instances much more conservatively.  So in non-debug mode, it's best to
not even *define* it.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3meCUACgkQ0F+nu1YWqI3TAACfaBDMgee0LBKcjygomcoo3M/a
FNQAnjJ0BWanzinazVoza11TL+rPlk5v
=dp2l
-----END PGP SIGNATURE-----



More information about the bazaar mailing list