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-March/147638.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 referenceMRAB python at mrabarnett.plus.com
Mon Mar 20 16:36:12 EDT 2017
On 2017-03-20 20:23, Antoine Pitrou wrote:
>
> Hello Oleg,
>
> On Mon, 20 Mar 2017 18:28:29 +0100
> Oleg Nesterov <oleg at redhat.com> wrote:
>> I started to learn python a few days ago and I am trying to understand what
>> __del__() actually does. https://docs.python.org/3/reference/datamodel.html
>> says:
>>
>> 	object.__del__(self)
>> 	...
>> 	Note that it is possible (though not recommended!) for the __del__()
>> 	method to postpone destruction of the instance by creating a new
>> 	reference to it. It may then be called at a later time when this new
>> 	reference is deleted.
>
> This sentence is not technically wrong, but it can easily be
> misleading.  It says "it *may* then be called at a later time" and
> probably it should say "it may or may not be called at a later time,
> depending on the Python implementation you are using".
>
[snip]

I don't think I'd say it's misleading, but only that it might be 
misunderstood.

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