deleting an object

Karl Kobata karl.kobata at syncira.com
Thu Sep 25 21:03:31 EDT 2008


Please help.  Questions based on snippet of code below.

1)       when myTestCase is deleted, is just the pointer deleted or the
entire instance with all of its data and data structure deleted?

2)       What is the practice for deleted the object and recovering the
memory it occupies?

3)       If delete is the way, what happens to 'testUtils.utilFunction1()'
if it were instantiated in other classes that have not been deleted yet?

 

Thanks for your help.

 

 

 

Example:

import testUtils

 

class testClass:

            def __init__(self):

                        self.testList = list()

                        self.testDict1 = dict()

                        self.utils1 = testUtils.utilFunction1()

                        ...

                        

                        

...in the main code body.

            myTestCase = testClass()

            ....

            delete myTestCase

            ...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080925/b2e9abe1/attachment.html>


More information about the Python-list mailing list