Giovanni Bajo wrote: > What I really meant was: > > self.__wr = weakref.ref(self, ...)
Okay, that looks better. But I'm not sure what will happen if the holder becomes part of a cycle. If the GC picks the holder as the object to clear to break the cycle, then the weakref will be deallocated before the holder, and the callback won't be called. So it doesn't seem to be an improvement over __del__. -- Greg _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com