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/2003-November/040226.html below:

[Python-Dev] subtype_dealloc needs rethinking

[Python-Dev] subtype_dealloc needs rethinking [Python-Dev] subtype_dealloc needs rethinkingTim Peters tim.one at comcast.net
Thu Nov 13 15:17:53 EST 2003
[Tim]
> ...
> There are two identifiable (so far) problems in subtype_dealloc

Make that one; I'm convinced the first is bogus.

> ...
> 1. A weakref callback can resurrect self, but the code isn't aware of
>    that now.

I no longer believe that's possible.  While a weakref callback can resurrect
objects in dead cycles, a weakref callback called *as a result* of anything
subtype_dealloc does cannot resurrect the object subtype_dealloc is tearing
down (because self's refcount is legitimately 0 then -- Python code can't
get to self, even if it was in a dead cycle, and the weakref callback
doesn't pass the dying object to the callback either).

That just leaves subtype_dealloc with its problem of allowing gc to believe
that self is collectible.  I'm feeling more confident about that too after
staring at the code more, but a complete fix remains strained.


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