Searching equivalent to C++ RAII or deterministic destructors

Ulrich Eckhardt eckhardt at satorlaser.com
Fri Jul 3 07:58:44 EDT 2009


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




More information about the Python-list mailing list