obj in list and list ids the same

rdudfield at my-deja.com rdudfield at my-deja.com
Tue Dec 28 07:04:56 EST 1999


Hello,

I've got a problem where a list has the same id as a object instance in that
same list.  This is as returned by id().

Is this ever supposed to happen?  I just thought this was odd.	This happens
when I am trying to copy a list of objects (sheets ) in the current object
into a object which is also in a list( not the same one).  Then I try to copy
a object (shape) from a global list into a list inside a sheet object which
is inside a list in the node object.

The real problem I am having is when from in a method of an object(node), I
copy a self.list of objects ( using copy.copy ) into a new node that I have
created.  This bit seems to work all right.  The problem happens when I
insert a object(shape) into a list within a node objects list of shapes.  I
hope this all makes sense...

What it does is make the shape appear in sheet object in current node as
well.  This shouldn't happen.


Any tips for getting around referencing problems?  Like what are the prefered
ways to copy a list?  I didn't post the source cause I thought it was a bit
big.


Thanks for any help in advance.


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list