can i safely assume that __del__ will always be called

Karthik Gurumurthy karthikg at aztec.soft.net
Sat Aug 18 05:15:51 EDT 2001


Unlike Java where am not really sure when finalize will be called,
can i be sure that __del__ of my resource w'd be called when someone does
a del(ref) as long as ref in the only refernce to the Resource object.


def useResouuce():
	res = DBResource()
	#use DBresource
	del(res)


Even if someone does'nt do a del,

__del__ w'd be immdiately called when the scope of function useResource
completes??

If that is the case i need not rely on the client to do
clean-up of the source explicitly?.

thanks,
karthik.





More information about the Python-list mailing list