Hello,

I got a problem deleting objects, which are placed in a hirarchy....

Asume we have the following code:
########################################################
class parent:

    MyChilds = [] # this list is filled with childs....

    def AddChild(self, child):
        # add childs here, however this is done, it's not the point...
        child.MyParent = self

    def RemoveChild(self, child):
        # delete child from the list.... the way this is done is not
our
        # problem here


class child:

    MyParent = 0

    def deleteMe(self):
        MyParent.RemoveChild(self)
##############################################################

So my code looks something like that.... and it works. I works because
you do not touch any member variables in class child after deleting
it... But is this nice code??? Is there another way to delete
yourself???

Thanks for any comments...
Chris

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to