[Twisted-Python] cleanup in twisted

Bob Ippolito bob at redivi.com
Sun May 22 10:10:33 MDT 2005


On May 22, 2005, at 8:46 AM, Joachim Boomberschloss wrote:

> I just jotted down a little mechanism for cleaning-up
> in Twisted, and I wanted to see if:
> 1. other people think it's needed
> 2. other people manage to use it
>
> What this does is enable one to define a __cleanup__
> method which gets call either when the instance is
> deleted, or when the reactor shuts down. It can return
> a dereffed that delays the shutdown. The benefit is
> being able to define communication-related stuff in
> the cleanup method, which is not so useful to do in
> __del__.

This is just begging for object leaks, because __del__ disables  
aspects of cyclic GC.

-bob





More information about the Twisted-Python mailing list