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/2017-April/147742.html below:

[Python-Dev] __del__ is not called after creating a new reference

[Python-Dev] __del__ is not called after creating a new reference [Python-Dev] __del__ is not called after creating a new referenceArmin Rigo armin.rigo at gmail.com
Sun Apr 2 04:20:36 EDT 2017
Hi all,

On 20 March 2017 at 22:28, Nathaniel Smith <njs at pobox.com> wrote:
> Modern CPython, and all extant versions of PyPy and Jython, guarantee that
> __del__ is called at most once.

Just a note, if someone actually depends on this: it is not true in
all cases.  For example, in CPython 3.5.3:

>>> class X:
...   __slots__=()        #   <= note this!
...   def __del__(self):
...     print("DEL")
...     global resurrect
...     resurrect = self
...
>>> print(X())
<__main__.X object at 0x7f5d1ad600d0>
DEL
>>> resurrect=None
DEL
>>> resurrect=None
DEL
>>> resurrect=None
DEL


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