def test(self, out=None):
    if out is None:
        out = {}
key = 'key'
for i in ['a', 'b', 'c', 'd']:
    if key in out:
        out[key] += ',' + i
else:
    out[key] = i
return out
Why does initializing a variable via a python default variable keep state across object instantiation?