From: Michal Suchanek Date: 2007-12-23T04:07:42+09:00 Subject: Re: First stab at a weakref test suite On 22/12/2007, Daniel Berger wrote: > I took a look at the Python weakref test suite. I quickly realized > that it appeared to be a richer interface. Maybe that's part of the > problem - the interface we have isn't testable. Take a look here: > > http://www.python.org/doc/2.4/lib/module-weakref.html > > Then again, maybe I'm way off base. Anyway, I think we should at least > take a look at it and see if we want to steal any ideas from it. The > corresponding test file is test_weakref.py, btw. Apparently the reason the python weakref is testable is that you can explicitly delete an object. At least that's what the test code seems to do. This is not possible in ruby, and the ruby gc is not deterministic enough to always free all unused objects. So it's not the weakref what would need changing to make weakref testable but the memory allocation (and especially deallocation) interface. Thanks Michal