order that destructors get called?

Brendan Miller catphive at catphive.net
Thu Apr 8 21:03:26 EDT 2010


Thanks Steven and Gabriel. Those are very informative responses.

In my case my resource isn't bound to a lexical scope, but the:

def __del__(self,
                  delete_my_resource=delete_my_resource):

pattern works quite well. I've made sure to prevent my class from
being part of a circular reference, so that the __del__ shouldn't be
an issue.

Brendan



More information about the Python-list mailing list