Lists are weird when they are instance members
robin at jessikat.fsnet.co.uk
Sat Jan 3 23:58:01 CET 2004
In article <ffHJb.5475$HL3.4277 at newssvr29.news.prodigy.com>, python
newbie <mesteve_b at hotmail.com> writes
I think you're not grokking that using
mylist = 
makes mylist a class attribute ie all instances share the same version
of mylist. To get an instance version you need to assign self.mylist.
That would normally be done using an __init__method. so
self.mylist = 
then each instance sets up its own empty list at creation time.
Hope that helps.
More information about the Python-list