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/2014-October/136773.html below:

[Python-Dev] results of id() and weakref.getweakrefs() sometimes break on object resurrection

[Python-Dev] results of id() and weakref.getweakrefs() sometimes break on object resurrection [Python-Dev] results of id() and weakref.getweakrefs() sometimes break on object resurrectionArmin Rigo arigo at tunes.org
Sun Oct 26 18:44:53 CET 2014
Hi Stefan,

On 26 October 2014 02:50, Stefan Richthofer <Stefan.Richthofer at gmx.de> wrote:
> It appears weakrefs are only cleared if this is done by gc (where no
> resurrection can happen anyway). If a resurrection-performing-__del__ is
> just called by ref-count-drop-to-0, weakrefs persist -

How do you reach this conclusion?  The following test program seems to
show the opposite, by printing None on Python 2.7.6:

    import weakref
   class X(object):
        def __del__(self):
            print ref()
    x = X()
    ref = weakref.ref(x)
    del x


A bientôt,

Armin.
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