python 1.5.2 memory leak?

D-Man dsh8290 at rit.edu
Sat Nov 18 12:21:57 EST 2000


'a' should go away (be unrefed) at the end of its scope.  Its scope ends at the end of the function (I believe).  If the loop is at the module level it might not go away (but I haven't tested).  Explicitly unrefing it (calling del) can't hurt as long as you know you don't need it (the local reference, that is).

-D

On Fri, 17 Nov 2000 09:16:48 Taz wrote:
 | 
 | i don't del the re-used vasriables eg
 | 
 |     while 1:
 |         a = something
 |         other stuff
 | 
 | i don;t think i need to del a at the end of the loop do i?
 | 
 | thanks for the thoughts
 | 
 | Gene C <gchiaramonte at yahoo.com> wrote in message
 | news:EY9R5.719$n9.128801 at newsread2.prod.itd.earthlink.net...
 | > You could try using del, but I doubt it will matter.
 | >
 | > >>> n = "abc"
 | > >>> del n
 | > >>> n
 | > Traceback (innermost last):
 | >   File "<interactive input>", line 1, in ?
 | > NameError: n
 | > >>>
 | >
 | >
 | 
 | 
 | -- 
 | http://www.python.org/mailman/listinfo/python-list
 | 






More information about the Python-list mailing list