Why this code:
class B:
val = []
for i in range(0, 5):
obj = B()
print(obj.val)
obj.val.append('a')
has such output?
[]
['a']
['a', 'a']
['a', 'a', 'a']
['a', 'a', 'a', 'a']
In each iteration new B object is created. Why it has value of previous one?