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

2017-04-02 Thread Oleg Nesterov
On 04/02, Armin Rigo wrote: > > Hi all, > > On 20 March 2017 at 22:28, Nathaniel Smith 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

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

2017-04-02 Thread Armin Rigo
Hi all, On 20 March 2017 at 22:28, Nathaniel Smith 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: ..

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

2017-03-21 Thread Oleg Nesterov
On 03/20, Nathaniel Smith wrote: > > Modern CPython, and all extant versions of PyPy and Jython, guarantee that > __del__ is called at most once. MicroPython doesn't support user-defined > __del__ methods. > > It's fine if the text wants to leave that open, but the current phrasing is > pretty misl

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

2017-03-20 Thread Nathaniel Smith
On Mar 20, 2017 1:26 PM, "Antoine Pitrou" wrote: Hello Oleg, On Mon, 20 Mar 2017 18:28:29 +0100 Oleg Nesterov 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: > > ob

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

2017-03-20 Thread MRAB
On 2017-03-20 20:23, Antoine Pitrou wrote: Hello Oleg, On Mon, 20 Mar 2017 18:28:29 +0100 Oleg Nesterov 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__(

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

2017-03-20 Thread Antoine Pitrou
Hello Oleg, On Mon, 20 Mar 2017 18:28:29 +0100 Oleg Nesterov 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