On 9 Dec., 17:35, Albert Hopkins <[EMAIL PROTECTED]> wrote: > I'm looking at a person's code and I see a lot of stuff like this: > > def myfunction(): > # do some stuff stuff > my_string = function_that_returns_string() > # do some stuff with my_string > del my_string > # do some other stuff > return > > and also > > def otherfunction(): > try: > # some stuff > except SomeException, e: > # more stuff > del e > return > > I think this looks ugly, but also does it not hurt performance by > preempting the gc? My feeling is that this is a misuse of 'del'. Am I > wrong? Is there any advantage of doing the above?
I agree with you. In my mind there is no reason for such kinds of deletes. The code seems to have been made by a person who úsually programs in a language which does not have a garbage collector. I do not know if it has any noticeable impact on the performance. -- Slaunger -- http://mail.python.org/mailman/listinfo/python-list