A
Albert Hopkins
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?
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?