Message6798

Author fwierzbicki
Recipients danilo2, fwierzbicki
Date 2012-03-15.16:04:36
SpamBayes Score 3.082661e-06
Marked as misclassified No
Message-id <1331827476.8.0.208980423065.issue1851@psf.upfronthosting.co.za>
In-reply-to
Content
Hi danilo2,

Looking at weakref at http://docs.python.org/library/weakref.html you'll note the paragraph:

A weak reference to an object is not enough to keep the object alive: when the only remaining references to a referent are weak references, garbage collection is free to destroy the referent and reuse its memory for something else.

Of particular note is "garbage collection is free to destroy..."

So even though the current implementation of CPython appears to destroy the weakref in a deterministic fashion, that will be due to it's reference counted gc implementation. Jython does not have deterministic garbage collection and so will not immediately destroy the weakref. In fact the time of destruction is in no way guaranteed.
History
Date User Action Args
2012-03-15 16:04:36fwierzbickisetmessageid: <1331827476.8.0.208980423065.issue1851@psf.upfronthosting.co.za>
2012-03-15 16:04:36fwierzbickisetrecipients: + fwierzbicki, danilo2
2012-03-15 16:04:36fwierzbickilinkissue1851 messages
2012-03-15 16:04:36fwierzbickicreate