> dasacc22 (d) wrote:
>d> The property method of parent and children actually calls a
>d> _set_as_parent() and _set_as_child() method after setting the private
>d> variable to pack the object for display purposes so that children can
>d> be detached from the parent (becoming its own parent) a
On Apr 24, 4:04 am, Piet van Oostrum wrote:
> > dasacc22 (d) wrote:
> >d> Ah thank you for clarifying, I did confuse instance and class
> >d> attributes from creating the list in the class def. I actually just
> >d> spiffed up that class to represent a portion of a much larger class
> >d> tha
> dasacc22 (d) wrote:
>d> Ah thank you for clarifying, I did confuse instance and class
>d> attributes from creating the list in the class def. I actually just
>d> spiffed up that class to represent a portion of a much larger class
>d> that needs getter and setter for children. Doing as you s
On Mon, 20 Apr 2009 18:18:39 +0100, dasacc22 wrote:
Ah thank you for clarifying, I did confuse instance and class
attributes from creating the list in the class def. I actually just
spiffed up that class to represent a portion of a much larger class
that needs getter and setter for children. Do
dasacc22 wrote:
Hi,
I seem to be having a problem with a list being share across multiple
instantiations of it and dont quite understand why this is happening.
Class attributes are shared by all instances.
My class looks like this,
class Widget(object):
_parent = None
_children = []
Ah thank you for clarifying, I did confuse instance and class
attributes from creating the list in the class def. I actually just
spiffed up that class to represent a portion of a much larger class
that needs getter and setter for children. Doing as you said fixed my
problem, heres the code as refe
dasacc22 wrote:
> Hi,
>
> I seem to be having a problem with a list being share across multiple
> instantiations of it and dont quite understand why this is happening.
>
> My class looks like this,
>
> class Widget(object):
> _parent = None
> _children = []
>
> def __init__(self, p
Hi,
I seem to be having a problem with a list being share across multiple
instantiations of it and dont quite understand why this is happening.
My class looks like this,
class Widget(object):
_parent = None
_children = []
def __init__(self, parent=None):
self.parent = parent