When (and why) to use del?
marduk at letterboxes.org
Tue Dec 9 17:35:17 CET 2008
I'm looking at a person's code and I see a lot of stuff like this:
# do some stuff stuff
my_string = function_that_returns_string()
# do some stuff with my_string
# do some other stuff
# some stuff
except SomeException, e:
# more stuff
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?
More information about the Python-list