I have a python question about object's attribute. Code:
>>> class A(object):
... dict = {}
... def stuff(self, name):
... self.dict[name] = 'toto'
...
>>> a = A()
>>> print a.dict
{}
>>> a.stuff('un')
>>> print a.dict
{'un': 'toto'}
>>> b = A()
>>> print b.dict
{'un': 'toto'}
I'm a PHP devlopper and in PHP rint b.dict will be {}. Why python share this attribute between a and b ? What is the way to define class attribute who will be new on new instantiation?