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 -- http://mail.python.org/mailman/listinfo/python-list