On Fri, 23 Jan 2004 10:31:59 -0500 Chris McDonough <chrism@plope.com> wrote:
Defining __del__ on a persistent object has unknown effects, FWIW. A persistent object's __del__ method may be called many times during its lifetime. See
http://zope.org/Wikis/ZODB/FrontPage/guide/node3.html#SECTION000360000000000...
for more info.
In fact, the original poster points out a very real problem with __del__. If the __del__ function access any attribute of the object, it will put the object back in the cache. I hadn't thought of that before, but it's obvious now that it would work this way. The only useful answer is to avoid using __del__ on persistent objects. If there are resources that really need to be finalized whenever the object is ghosted, you can put them in a non-persistent sub-object that does have an __del__. Jeremy