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/2006-April/063418.html below:

[Python-Dev] reference leaks, __del__, and annotations

[Python-Dev] reference leaks, __del__, and annotationsGreg Ewing greg.ewing at canterbury.ac.nz
Wed Apr 5 01:18:25 CEST 2006
Tim Peters wrote:
> A problem is that the variant semantics also seem pretty arbitrary ;-),
> and there's a dearth of compelling use cases to guide a decision.

At the time I think I suggested that it would be
reasonable if weakref callbacks were guaranteed to
be called as long as they weren't trash themselves
and they didn't reference any trash. From what you
said in a recent message, it sounds like that's
the way it currently works.

These semantics would be sufficient to be able to
use weakrefs to register finalisers, I think. You
keep a global list of weakrefs with callbacks that
call the finalizer and then remove the weakref
from the global list.

I'll put together a prototype some time and see if
it works. I actually have a use case at the moment --
a couple of types that need to release external
resources, and since they're part of a library
I'm distributing, I can't be sure people won't put
them in cycles.

--
Greg
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