05 Jan 10




In Python, destructors are not as needed as in C++, because Python has a garbage collector that handles memory management. However, while memory is the most common resource allocated, it is not the only one. There are also sockets and database connections to be closed, files, buffers and caches flushed and a few more resources that need to be released when an object is done with them.

by mlb 16 years ago saved 2 times

16 Dec 09

@asolovyov really short version: ;-) (surely I need to do something more serious :P) #python

by piranha 16 years ago