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

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

[Python-Dev] reference leaks, __del__, and annotationsMichael Hudson mwh at python.net
Mon Apr 3 10:03:43 CEST 2006
"Thomas Wouters" <thomas at python.org> writes:

> While we're at it, I would like for the new __del__ (which would
> probably have to be a new method) to disallow reviving self, just
> because it makes it unnecessarily complicated and it's rarely
> needed.

I'm not sure the problem is so much that anyone _wants_ to support
resurrection in __del__, it's just that it can't be prevented.

    l = []
    class A(object):
     def __del__(self):
      l.append(self)
    a = A()
    a = 1

What would you have this do?

And if we want to have a version of __del__ that can't reference
'self', we have it already: weakrefs with callbacks.  What happened to
the 'get rid of __del__ in py3k' idea?

Cheers,
mwh

-- 
  <freeside> On a scale of One to AWESOME, twisted.web is PRETTY
             ABSTRACT!!!!                       -- from Twisted.Quotes
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