, [] , . , .
class Foo(object):
a = {}
b = 0
c = []
- (Foo.a, ), (Foo().a). __dict__. ( , , ), Foo __dict__ , , Foo().a, , Foo.a.
__init__.
class Foo(object):
def __init__(self):
self.x = {}
'__dict__, , Foo.x, Foo().x. , x - , .
.
class Foo(object):
def mutate(self, key, value):
self.x[key] = value
self.a[key] = value
self.b = value
self.c.append(value)
, self.x = {} ? self.b = value - , , (, Python-, , ).
self.a self.c - ( , ) - , ( ). self.x -, , .
self.c - , [10, 20].