In python 3.7, I'm trying to use an instance-specific list and for some reason, it behaves like a class attribute.
class Acc:
def __init__(self, items = []):
self.items = items
def add(self, value):
self.items.append(value)
Then I use
a = Acc()
b = Acc()
a.add(42)
print(b.items)
and get [42]
. Why?