[issue39556] Different objects of the same class references the same dictionary

2020-02-04 Thread Kevin Young
Kevin Young added the comment: Thank you, Ammar! I thought the default values were locally scoped under the __init__() function. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39556] Different objects of the same class references the same dictionary

2020-02-04 Thread Kevin Young
New submission from Kevin Young : Test code: class Test(object): def __init__(self, a={}): self._a = a def put(self, k, v): self._a[k] = v if __name__ == '__main__': t1 = Test() t1.put('aa', '11') t1.put('bb', &