How can I use keyword args in an initialiser without sharing it between instances of a class?
Example of the bad behaviour below, if I were to add anything to the set foo
then it would be added in both instances.
In [1]: class Klass:
def __init__(self, foo=set()):
self.foo = foo
In [2]: a = Klass()
In [3]: b = Klass()
In [4]: a.foo is b.foo
Out[4]: True