Cleanup when a object dies

Benjamin musiccomposition at
Wed Jan 23 04:54:42 CET 2008

I writing writing a class to allow settings (options, preferences) to
written file in a cross platform manner. I'm unsure how to go a about
syncing the data to disk. Of course, it's horribly inefficient to
write the data every time something changes a value, however I don't
see how I can do it on deletion. I've read that __del__ methods should
be avoided. So am I just going to have to force the client of my
object to call sync when they're done?

More information about the Python-list mailing list