Your test program performs no resurrection of x.
Interestingly, it does not change behavior if you write
class X(object):
def __del__(self):
X.x = self
print ref()
(Thanks for making me aware of this! My test-case was already
initially the more complex one given below)
But
On Mon, 27 Oct 2014 14:36:31 +0100
Stefan Richthofer stefan.richtho...@gmx.de wrote:
Your test program performs no resurrection of x.
Interestingly, it does not change behavior if you write
class X(object):
def __del__(self):
X.x = self
print ref()
(Thanks for
It's not that resurrection occurs indirectly, it's that the object
pointed to by x2 always remains alive
Yes, this is right for CPython, more precisely this is about the definition
of the word resurrection (in language-independent sense),
which seems not to be unique.
I already pointed out
One
On Mon, 27 Oct 2014 16:20:06 +0100
Stefan Richthofer stefan.richtho...@gmx.de wrote:
I already pointed out
One can surely argue x2 has never been dead, or see it as
it was killed along with x and then resurrected by x.
In Java and thus in Jython, it is treated as the second one.
You mean
You mean Jython deletes instance attributes before calling __del__ ?
No. I think the term of object resurrection usually does not mean bringing
back a deleted object in the sense that memory was already freed.
I think it rather means that nothing referred to an object, so it was on the
On Mon, 27 Oct 2014 17:23:23 +0100
Stefan Richthofer stefan.richtho...@gmx.de wrote:
You mean Jython deletes instance attributes before calling __del__ ?
No. I think the term of object resurrection usually does not mean bringing
back a deleted object in the sense that memory was already
I already admitted that it is implementation specific whether one would
talk of resurrection, even in one and the same scenario. (Although
I would prefer to agree on an abstract notion of the resurrection term.)
If Jython does things differently, then certainly its behaviour is
incompatible
On Mon, 27 Oct 2014 18:40:24 +0100
Stefan Richthofer stefan.richtho...@gmx.de wrote:
If Jython does things differently, then certainly its behaviour is
incompatible with the common expectations of Python developers.
Guido recently pointed out that it is allowed for different Python
On 10/27/2014 12:23 PM, Stefan Richthofer wrote:
You mean Jython deletes instance attributes before calling __del__ ?
No. I think the term of object resurrection usually does not mean
bringing
back a deleted object in the sense that memory was already freed.
I think it rather means that
I think 'resuscitation' might be a better metaphor.
The term 'resurrection' is not my invention, but well established:
http://en.wikipedia.org/wiki/Object_resurrection
I well understand why Antoine objects to calling it resurrection in CPython
due to
implementation specific reasons. But in the
You shouldnt have to emulate that. The exact behavior of GC is allowed to vary between systems.
Yes, of course. I am looking into this for JyNI, which in contrast should emulate CPython behavior as good as possible.
And for such details, -one by one- I am currently weighting up whether its
Hi Stefan,
On 26 October 2014 02:50, Stefan Richthofer stefan.richtho...@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
Hello developers,
I observed strange behaviour in CPython (tested in 2.7.5 and 3.3.3)
regarding object resurrection.
Yes, resurrection is evil, but it is a valid scenario. If an object is
resurrected via its finalizer __del__, sometimes its unique id value as
returned from id() changes.
Hello Stefan,
On Sun, 26 Oct 2014 00:20:47 +0200
Stefan Richthofer stefan.richtho...@gmx.de wrote:
Hello developers,
I observed strange behaviour in CPython (tested in 2.7.5 and 3.3.3)
regarding object resurrection.
Your runGC() function is buggy, it does not run the GC under CPython.
Fix
Okay, sorry, I was thinking too Jython-like. I fixed runGC() just to
see now that it does not even trigger resurrection, since under
CPython there are no finalizers executed in ref cycles (i.e. I find my
objects in gc.garbage).
So I realize, my xy_cyclic tests are pointless anyway since in cyclic
On Sun, 26 Oct 2014 02:50:39 +0200
Stefan Richthofer stefan.richtho...@gmx.de wrote:
Okay, sorry, I was thinking too Jython-like. I fixed runGC() just to
see now that it does not even trigger resurrection, since under
CPython there are no finalizers executed in ref cycles (i.e. I find my
On Saturday, October 25, 2014, Stefan Richthofer stefan.richtho...@gmx.de
wrote:
Okay, sorry, I was thinking too Jython-like. I fixed runGC() just to
see now that it does not even trigger resurrection, since under
CPython there are no finalizers executed in ref cycles (i.e. I find my
objects
17 matches
Mail list logo