Fredrik Lundh wrote:
> if you want separate instances to use separate objects, make sure you
> create new objects for each new instance. see Tim's reply for how to
> do that.
kath's response is probably better.
In Python, you don't define the instance members in the class scope
like the OP has done:
> > class A:
> > name = ""
> > data = []
You define them when you attach them to an instance, e.g.
class A:
def __init__(self):
self.member1 = 'a'
def ThisWorksToo(self):
self.member2 = 'b'
# this also works
a = A()
a.member3 = 'c'
-tom!
--
http://mail.python.org/mailman/listinfo/python-list