Thanks to all that answered, in particular I wasn't aware of the existence of the __del__ function.
For completeness' sake, I think I have found another way to not really solve but at least circumvent the problem: weak references. If I understand correctly, those would allow me to pass out handles to the resources and, if some code decides it is time, release the resources and render all the weak references invalid. At least I don't suffer resource leaks but rather get meaningful errors that way, which is enough for my case. cheers! Uli -- Sator Laser GmbH Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932 -- http://mail.python.org/mailman/listinfo/python-list