> Because you declare myList to be a *class*-level variable, which means *all* > instances of that class (a and b in your case) *share* it. Python does not > declare *instance* variables the way you do. > > Instead, do this: > > class Foo(object): > def __init__(self): > self.myList = []
Interesting, but that does not explain the difference in the behavior of myList and myInt Both were class-level variables, as far as I can see, and therefor a and b should also share it And good remind on default arguments :) -- http://mail.python.org/mailman/listinfo/python-list